Answers for "it vs describe jest"

4

jest timeout

beforeEach(function () {
        jest.setTimeout(2000) // ms
    });
Posted by: Guest on March-16-2020
2

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();
  });
}
Posted by: Guest on June-09-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language