Function testImport

  • Import a file that exports a Test or an Iterable of Test.

    Example

    testImport(new URL("file:///example/test.test.js"));
    // AsyncIterable<[
    // {
    // given: "example 1",
    // must: "example 1",
    // received: () => "value 1",
    // wanted: () => "value 1"
    // },
    // {
    // given: "example 2",
    // must: "example 2",
    // received: () => "value 2",
    // wanted: () => "value 2"
    // },
    // ]>

    Yields

    Imported tests.

    Parameters

    • path: ReadOnlyDeepRecord<URL>

      Path to the test file.

    Returns AsyncGenerator<Test<unknown>, void, unknown>