ConformanceTestCase

Type

Signature

type ConformanceTestCase<TContext> = {
  group: string;
  name: string;
  run: (context) => Promise<void>;
  title: string;
};

core/src/conformance/suite.ts:11

One conformance case, to wrap in a test of any test runner. The test file creates the context before the cases (for example in beforeAll) and releases the resources behind it, such as the database, after them.

The cases of a list share one context, so run them one at a time: not with test.concurrent, vitest's sequence.concurrent or another runner's concurrent mode.

Type Parameters

  • TContext

Properties

  • group
    string

    The group the case belongs to, such as createJobs.

  • name
    string

    The case's own name, without its group.

run

Signature

run: (context) => Promise<void>;

core/src/conformance/suite.ts:23

Runs the case against the context. Resolves when the case passes and rejects when it fails.

Parameters

  • context
    TContext

Returns

Promise<void>

Throws

Error if context is undefined, as when the hook that creates it failed.

  • title
    string

    A test name made of the group and the case's name: <group> > <name>.

esc

Search guides, integrations and every exported symbol.

↑ ↓ to navigate↵ to open