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
  4cfa9f8e_9d7f_f7a6_aa97_ccfc3ed8b6e9["next-tick.spec.ts"]
  445da547_9a64_2d88_bdf3_74751126cfc2["next-tick"]
  4cfa9f8e_9d7f_f7a6_aa97_ccfc3ed8b6e9 --> 445da547_9a64_2d88_bdf3_74751126cfc2
  style 4cfa9f8e_9d7f_f7a6_aa97_ccfc3ed8b6e9 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