Function testImport

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

    Example

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

    Returns

    A promise with an array of Test and the path.

    Parameters

    • path: Readonly<URL>

      Path to the test file.

    Returns Promise<Test<unknown>[]>