Setup and Teardown (ok)
https://jestjs.io/docs/setup-teardown
Repeating Setup For Many Tests
beforeEach(() => {
initializeCityDatabase();
});
afterEach(() => {
clearCityDatabase();
});
test('city database has Vienna', () => {
expect(isCity('Vienna')).toBeTruthy();
});
test('city database has San Juan', () => {
expect(isCity('San Juan')).toBeTruthy();
});One-Time Setup
Scoping
Order of execution of describe and test blocks
General Advice
Last updated