Q:

beforeeach jest

describe('some testing', () => {
  let isCity;
  
  beforeEach(() => {
    isCity = 'Vienna';
  });

  afterEach(() => {
    isCity = null;
  });

  test('city database has Vienna', () => {
    expect(isCity('Vienna')).toBeTruthy();
  });

  test('city database has San Juan', () => {
    expect(isCity('San Juan')).toBeTruthy();
  });
}
1

New to Communities?

Join the community