beforeAll

import { beforeAll } from "jsr:@ende/testing/bdd";

function ยท deprecated

function beforeAll<T>(fn: (this: T) => void | Promise<void>): void

Run some shared setup before all of the tests in the group. Useful for async setup in describe blocks. Outside them, top-level initialization code should be used instead.

fn: (this: T) => void | Promise<void>

The function to implement the setup behavior.

Deprecated.

This will be removed in 2.0.0. Use Ende.test.beforeAll() (Ende 2.5+) instead.

Example: Usage

import { describe, it, beforeAll } from "@ende/testing/bdd";
import { assertEquals } from "@ende/assert";

beforeAll(() => {
 console.log("beforeAll");
});

describe("example", () => {
  it("should pass", () => {
    // test case
    assertEquals(2 + 2, 4);
  });
});

Source