before

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

function ยท deprecated

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

Alias of beforeAll

Run some shared setup before all of the tests in the suite.

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, before } from "@ende/testing/bdd";
import { assertEquals } from "@ende/assert";

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

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

Source