Skip to content

Start-up / shut-down tasks? #104

Answered by mindplay-dk
mindplay-dk asked this question in Q&A
Discussion options

You must be logged in to vote

My solution for now is, I take control of the test-harness myself - I added a test.ts:

import { createHarness } from "zora";

export const harness = createHarness({});

export const { test } = harness;

Calling createHarness disables the default, global harness.

In all of my tests, I import { test } from "./harness" instead of from "zora".

In the test entry-point script, I can then manually await the harness:

import { harness } from "./harness";
import { createJSONReporter } from "zora";
import { getTestServer } from "./test-server"; // 👆 see above

(async () => {

  await harness.report({
    reporter: createJSONReporter(),
  });

  const server = await getTestServer();

  await new Promise(

Replies: 1 comment 17 replies

Comment options

You must be logged in to vote
17 replies
@lorenzofox3
Comment options

@lorenzofox3
Comment options

@mindplay-dk
Comment options

@lorenzofox3
Comment options

@mindplay-dk
Comment options

Answer selected by lorenzofox3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants