methods-lifecycle.spec.ts — vue Source File
Architecture documentation for methods-lifecycle.spec.ts, a typescript file in the vue codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR ca019f5d_1e94_9e2d_9b0e_36b90be57f02["methods-lifecycle.spec.ts"] db9e7bef_009d_3918_6e7d_543a36a38d75["vue"] ca019f5d_1e94_9e2d_9b0e_36b90be57f02 --> db9e7bef_009d_3918_6e7d_543a36a38d75 33c70915_1726_ee82_246e_a7d09e56426a["dep"] ca019f5d_1e94_9e2d_9b0e_36b90be57f02 --> 33c70915_1726_ee82_246e_a7d09e56426a style ca019f5d_1e94_9e2d_9b0e_36b90be57f02 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import Vue from 'vue'
import Dep from 'core/observer/dep'
describe('Instance methods lifecycle', () => {
describe('$mount', () => {
it('empty mount', () => {
const vm = new Vue({
data: { msg: 'hi' },
template: '<div>{{ msg }}</div>'
}).$mount()
expect(vm.$el.tagName).toBe('DIV')
expect(vm.$el.textContent).toBe('hi')
})
it('mount to existing element', () => {
const el = document.createElement('div')
el.innerHTML = '{{ msg }}'
const vm = new Vue({
data: { msg: 'hi' }
}).$mount(el)
expect(vm.$el.tagName).toBe('DIV')
expect(vm.$el.textContent).toBe('hi')
})
it('mount to id', () => {
const el = document.createElement('div')
el.id = 'mount-test'
el.innerHTML = '{{ msg }}'
document.body.appendChild(el)
const vm = new Vue({
data: { msg: 'hi' }
}).$mount('#mount-test')
expect(vm.$el.tagName).toBe('DIV')
expect(vm.$el.textContent).toBe('hi')
})
it('Dep.target should be undefined in lifecycle', () => {
new Vue({
template: '<div><my-component></my-component></div>',
components: {
myComponent: {
template: '<div>hi</div>',
mounted() {
this.msg
expect(Dep.target).toBe(undefined)
},
computed: {
msg() {
return 1
}
}
}
}
}).$mount()
})
it('Dep.target should be undefined during invocation of child immediate watcher', done => {
let calls = 0
const childData = { a: 1 }
const parentUpdate = vi.fn()
// ... (126 more lines)
Dependencies
- dep
- vue
Source
Frequently Asked Questions
What does methods-lifecycle.spec.ts do?
methods-lifecycle.spec.ts is a source file in the vue codebase, written in typescript.
What does methods-lifecycle.spec.ts depend on?
methods-lifecycle.spec.ts imports 2 module(s): dep, vue.
Where is methods-lifecycle.spec.ts in the architecture?
methods-lifecycle.spec.ts is located at test/unit/features/instance/methods-lifecycle.spec.ts (directory: test/unit/features/instance).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free