Function run

  • Run all tests that have been enqueued.

    test('Test 1', () => {
    ok(true)
    })

    test('Test 2', () => {
    ok(true)
    })

    run()

    To organize tests in multiple files, only call run() in the entry file, such as index.ts. This ensures that there is a single report for all tests.

    import './test-1'
    import './test-2'

    run()

    Alternatively, if there are test files that also call run(), such as in a monorepo, pass a function that dynamically imports them. This enqueues all tests and runs them together with a single report at the end.

    run(async () => {
    await import('./test-1.js')
    await import('./test-2.js')
    })

    Parameters

    Returns Promise<void>

Generated using TypeDoc