Home / File/ next-tick.spec.ts — vue Source File

next-tick.spec.ts — vue Source File

Architecture documentation for next-tick.spec.ts, a typescript file in the vue codebase. 1 imports, 0 dependents.

File typescript 1 imports

Entity Profile

Dependency Diagram

graph LR
  987072d2_6a5a_6c3e_c553_297ee715ddd1["next-tick.spec.ts"]
  8353b6e5_6a64_65f2_c7e4_d649fd5d02b8["next-tick"]
  987072d2_6a5a_6c3e_c553_297ee715ddd1 --> 8353b6e5_6a64_65f2_c7e4_d649fd5d02b8
  style 987072d2_6a5a_6c3e_c553_297ee715ddd1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { nextTick } from 'core/util/next-tick'

describe('nextTick', () => {
  it('accepts a callback', done => {
    nextTick(done)
  })

  it('returns undefined when passed a callback', () => {
    expect(nextTick(() => {})).toBeUndefined()
  })

  if (typeof Promise !== 'undefined') {
    it('returns a Promise when provided no callback', done => {
      nextTick().then(done)
    })

    it('returns a Promise with a context argument when provided a falsy callback and an object', done => {
      const obj = {}
      nextTick(undefined, obj).then(ctx => {
        expect(ctx).toBe(obj)
        done()
      })
    })

    it('returned Promise should resolve correctly vs callback', done => {
      const spy = vi.fn()
      nextTick(spy)
      nextTick().then(() => {
        expect(spy).toHaveBeenCalled()
        done()
      })
    })
  }
})

Dependencies

  • next-tick

Frequently Asked Questions

What does next-tick.spec.ts do?
next-tick.spec.ts is a source file in the vue codebase, written in typescript.
What does next-tick.spec.ts depend on?
next-tick.spec.ts imports 1 module(s): next-tick.
Where is next-tick.spec.ts in the architecture?
next-tick.spec.ts is located at test/unit/modules/util/next-tick.spec.ts (directory: test/unit/modules/util).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free