create-element.spec.ts — vue Source File
Architecture documentation for create-element.spec.ts, a typescript file in the vue codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR e7e07032_730b_1524_1c7c_34641d539c18["create-element.spec.ts"] c5601857_7faf_30c6_efca_20de90db006c["vue"] e7e07032_730b_1524_1c7c_34641d539c18 --> c5601857_7faf_30c6_efca_20de90db006c f6868225_acf7_afdc_ebd3_15704ddb6566["vnode"] e7e07032_730b_1524_1c7c_34641d539c18 --> f6868225_acf7_afdc_ebd3_15704ddb6566 style e7e07032_730b_1524_1c7c_34641d539c18 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import Vue from 'vue'
import { createEmptyVNode } from 'core/vdom/vnode'
describe('create-element', () => {
it('render vnode with basic reserved tag using createElement', () => {
const vm = new Vue({
data: { msg: 'hello world' }
})
const h = vm.$createElement
const vnode = h('p', {})
expect(vnode.tag).toBe('p')
expect(vnode.data).toEqual({})
expect(vnode.children).toBeUndefined()
expect(vnode.text).toBeUndefined()
expect(vnode.elm).toBeUndefined()
expect(vnode.ns).toBeUndefined()
expect(vnode.context).toEqual(vm)
})
it('render vnode with component using createElement', () => {
const vm = new Vue({
data: { message: 'hello world' },
components: {
'my-component': {
props: ['msg']
}
}
})
const h = vm.$createElement
const vnode = h('my-component', { props: { msg: vm.message } })
expect(vnode.tag).toMatch(/vue-component-[0-9]+/)
expect(vnode.componentOptions.propsData).toEqual({ msg: vm.message })
expect(vnode.children).toBeUndefined()
expect(vnode.text).toBeUndefined()
expect(vnode.elm).toBeUndefined()
expect(vnode.ns).toBeUndefined()
expect(vnode.context).toEqual(vm)
})
it('render vnode with custom tag using createElement', () => {
const vm = new Vue({
data: { msg: 'hello world' }
})
const h = vm.$createElement
const tag = 'custom-tag'
const vnode = h(tag, {})
expect(vnode.tag).toBe('custom-tag')
expect(vnode.data).toEqual({})
expect(vnode.children).toBeUndefined()
expect(vnode.text).toBeUndefined()
expect(vnode.elm).toBeUndefined()
expect(vnode.ns).toBeUndefined()
expect(vnode.context).toEqual(vm)
expect(vnode.componentOptions).toBeUndefined()
})
it('render empty vnode with falsy tag using createElement', () => {
const vm = new Vue({
data: { msg: 'hello world' }
})
// ... (225 more lines)
Dependencies
- vnode
- vue
Source
Frequently Asked Questions
What does create-element.spec.ts do?
create-element.spec.ts is a source file in the vue codebase, written in typescript.
What does create-element.spec.ts depend on?
create-element.spec.ts imports 2 module(s): vnode, vue.
Where is create-element.spec.ts in the architecture?
create-element.spec.ts is located at test/unit/modules/vdom/create-element.spec.ts (directory: test/unit/modules/vdom).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free