Akryum/peeky

Top level `beforeAll`, `beforeEach()`, `afterAll`, and `afterEach`

posva opened this issue · 2 comments

posva commented

Right now, when these are declared outside of a describe(), they don't run. This would be useful to setup o mocking HTTP server like https://mswjs.io/ and adding it to setupFiles in the peeky config to automatically add this to all test suites:

import { server } from './mock/server.ts' // msw specific

beforeAll(() => server.listen())
afterEach(() => server.resetHandlers())
afterAll(() => server.close())

@posva I'm using it outside a describe() and it's working fine

posva commented

I think @Akryum implemented this but forgot to close it