How can I run code before and after each it block?
describe('the counter effect', () => {
let counter = 0
beforeEach(() => counter++)
afterEach(() => counter = 0)
it('should display one', () => expect(counter).toBe(1))
it('should still display one', () => expect(counter).toBe(1))
})
PreviousWhat sort of matchers can I use on my expect calls?NextHow can I mark tests as not having been implemented yet?
Last updated
Was this helpful?