SuiteLike: {
    filepath?: string;
    name: Suite.Name;
    run(abortSignal?: AbortSignal): Suite.Results | PromiseLike<Suite.Results>;
}

A suite of related tests that can be run together.

Type declaration

  • Optional Readonlyfilepath?: string

    The filepath to this SuiteLike, when available.

  • Readonlyname: Suite.Name

    The name of this SuiteLike.

  • run:function
    • Runs this SuiteLike.

      Parameters

      • OptionalabortSignal: AbortSignal

      Returns Suite.Results | PromiseLike<Suite.Results>

      The results of running this SuiteLike

      A synchronous implementation:

      const results = suite.run();
      

      An asynchronous implementation:

      const results = await suite.run();
      

      Using an AbortSignal to cancel the suite:

      const ac = new AbortController();
      const signal = ac.signal;

      suite
      .run(signal)
      .then(console.log)
      .catch(error => {
      if (error.name === 'AbortError') {
      console.log('The suite was aborted');
      }
      });

      ac.abort();