import { afterAll, beforeAll, describe, test } from "bun:test";
let unpredictableVar: string;
beforeAll(() => {
console.group("");
unpredictableVar = "top level";
});
afterAll(() => {
console.groupEnd();
console.info("");
});
test("top level test", () => {
console.info("", "{ unpredictableVar:", JSON.stringify(unpredictableVar), "}", "");
});
describe("describe 1", () => {
beforeAll(() => {
console.group("");
unpredictableVar = "describe 1";
});
afterAll(() => {
console.groupEnd();
console.info("");
});
test("describe 1 - test", () => {
console.info(
"",
"{ unpredictableVar:",
JSON.stringify(unpredictableVar),
"}",
"",
);
});
});
describe("describe 2 ", () => {
beforeAll(() => {
console.group("");
unpredictableVar = "describe 2";
});
afterAll(() => {
console.groupEnd();
console.info("");
});
test("describe 2 - test", () => {
console.info(
"",
"{ unpredictableVar:",
JSON.stringify(unpredictableVar),
"}",
"",
);
});
});