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.
describe
The self type of the function
The function to implement the setup behavior.
import { describe, it, beforeAll } from "@std/testing/bdd";import { assertEquals } from "@std/assert";beforeAll(() => { console.log("beforeAll");});describe("example", () => { it("should pass", () => { // test case assertEquals(2 + 2, 4); });}); Copy
import { describe, it, beforeAll } from "@std/testing/bdd";import { assertEquals } from "@std/assert";beforeAll(() => { console.log("beforeAll");});describe("example", () => { it("should pass", () => { // test case assertEquals(2 + 2, 4); });});
Run some shared setup before all of the tests in the group. Useful for async setup in
describeblocks. Outside them, top-level initialization code should be used instead.