method
test.Test.if
Referenced types
interface Test<T extends ReadonlyArray<unknown>>
Runs a test.
test("can check if using Bun", () => {
expect(Bun).toBeDefined();
});
test("can make a fetch() request", async () => {
const response = await fetch("https://example.com/");
expect(response.ok).toBe(true);
});
test("can set a timeout", async () => {
await Bun.sleep(100);
}, 50); // or { timeout: 50 }- condition: boolean
Runs the test concurrently with other concurrent tests, if
conditionis true.@param conditionif the test should run concurrently