Fbefore
Bun

function

test.before

function before(
fn?: HookFn,
options?: HookOptions
): void;

This function creates a hook that runs before executing a suite.

describe('tests', async () => {
  before(() => console.log('about to run some test'));
  it('is a subtest', () => {
    assert.ok('some relevant assertion here');
  });
});
@param fn

The hook function. If the hook uses callbacks, the callback function is passed as the second argument.

@param options

Configuration options for the hook.