Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 363 Bytes

08-Test.md

File metadata and controls

33 lines (22 loc) · 363 Bytes

install jest

yarn add --dev jest

jest config

add 'jest' to .eslintrc.json

"env": {
  "browser": true,
  "jest": true
},

add test example

mkdir src/__test__

create index.test.js under this folder

test("number", () => {
  expect(1).toBe(1);
});

Test

add following code in npm script "test": "jest"

run yarn test