todo

Bun

Symbol

Test.todo

todo(label: string, fn?: () => void | Promise<unknown> | (done: (err?: unknown) => void) => void, options?: number | TestOptions): void

Marks this test as to be written or to be fixed.

These tests will not be executed unless the --todo flag is passed. With the flag, if the test passes, the test will be marked as fail in the results; you will have to remove the .todo or check that your test is implemented correctly.

@param label

the label for the test

@param fn

the test function

@param options

the test timeout or options

Referenced types

interface TestOptions

  • repeats?: number

    Sets the number of times to repeat the test, regardless of whether it passed or failed.

  • retry?: number

    Sets the number of times to retry the test if it fails.

  • timeout?: number

    Sets the timeout for the test in milliseconds.

    If the test does not complete within this time, the test will fail with:

    'Timeout: test {name} timed out after 5000ms'