Home / File/ shim-done.ts — vue Source File

shim-done.ts — vue Source File

Architecture documentation for shim-done.ts, a typescript file in the vue codebase. 0 imports, 1 dependents.

File typescript VueCore Instance 1 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  e4962eab_6ad6_ac60_fc3c_d68eae89f884["shim-done.ts"]
  0e3275eb_033e_79be_7c0a_56de4c630110["vitest.setup.ts"]
  0e3275eb_033e_79be_7c0a_56de4c630110 --> e4962eab_6ad6_ac60_fc3c_d68eae89f884
  style e4962eab_6ad6_ac60_fc3c_d68eae89f884 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// wrap tests to support test('foo', done => {...}) interface
const _test = test

const wait = (): [() => void, Promise<void>] => {
  let done
  const p = new Promise<void>((resolve, reject) => {
    done = resolve
    done.fail = reject
  })
  return [done, p]
}

const shimmed =
  ((global as any).it =
  (global as any).test =
    (desc: string, fn?: any, timeout?: number) => {
      if (fn && fn.length > 0) {
        _test(
          desc,
          () => {
            const [done, p] = wait()
            fn(done)
            return p
          },
          timeout
        )
      } else {
        _test(desc, fn, timeout)
      }
    })

;['skip', 'only', 'todo', 'concurrent'].forEach(key => {
  shimmed[key] = _test[key]
})

export {}

Domain

Subdomains

Functions

Imported By

Frequently Asked Questions

What does shim-done.ts do?
shim-done.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain, Instance subdomain.
What functions are defined in shim-done.ts?
shim-done.ts defines 2 function(s): test, wait.
What files import shim-done.ts?
shim-done.ts is imported by 1 file(s): vitest.setup.ts.
Where is shim-done.ts in the architecture?
shim-done.ts is located at test/helpers/shim-done.ts (domain: VueCore, subdomain: Instance, directory: test/helpers).

Analyze Your Own Codebase

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

Try Supermodel Free