scheduler.spec.ts — vue Source File
Architecture documentation for scheduler.spec.ts, a typescript file in the vue codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR f0b32486_9c43_57a3_c242_c73e751e7d04["scheduler.spec.ts"] db9e7bef_009d_3918_6e7d_543a36a38d75["vue"] f0b32486_9c43_57a3_c242_c73e751e7d04 --> db9e7bef_009d_3918_6e7d_543a36a38d75 af685b49_362f_04d6_83f7_0b2ffece0105["scheduler"] f0b32486_9c43_57a3_c242_c73e751e7d04 --> af685b49_362f_04d6_83f7_0b2ffece0105 style f0b32486_9c43_57a3_c242_c73e751e7d04 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import Vue from 'vue'
import {
MAX_UPDATE_COUNT,
queueWatcher as _queueWatcher
} from 'core/observer/scheduler'
function queueWatcher(watcher) {
watcher.vm = {} // mock vm
_queueWatcher(watcher)
}
describe('Scheduler', () => {
let spy
beforeEach(() => {
spy = vi.fn()
})
it('queueWatcher', done => {
queueWatcher({
run: spy
})
waitForUpdate(() => {
expect(spy.mock.calls.length).toBe(1)
}).then(done)
})
it('dedup', done => {
queueWatcher({
id: 1,
run: spy
})
queueWatcher({
id: 1,
run: spy
})
waitForUpdate(() => {
expect(spy.mock.calls.length).toBe(1)
}).then(done)
})
it('allow duplicate when flushing', done => {
const job = {
id: 1,
run: spy
}
queueWatcher(job)
queueWatcher({
id: 2,
run() {
queueWatcher(job)
}
})
waitForUpdate(() => {
expect(spy.mock.calls.length).toBe(2)
}).then(done)
})
it('call user watchers before component re-render', done => {
const calls: any[] = []
const vm = new Vue({
// ... (125 more lines)
Domain
Subdomains
Functions
Dependencies
- scheduler
- vue
Source
Frequently Asked Questions
What does scheduler.spec.ts do?
scheduler.spec.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain, Observer subdomain.
What functions are defined in scheduler.spec.ts?
scheduler.spec.ts defines 1 function(s): queueWatcher.
What does scheduler.spec.ts depend on?
scheduler.spec.ts imports 2 module(s): scheduler, vue.
Where is scheduler.spec.ts in the architecture?
scheduler.spec.ts is located at test/unit/modules/observer/scheduler.spec.ts (domain: VueCore, subdomain: Observer, directory: test/unit/modules/observer).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free