1 Test javascript with jest

Article directory

1 Install jest

npm install --save-dev jest

Insert image description here

2 tests

1 Create javascript files and test files
Insert image description here
2 Create test commands
Insert image description here
It should be noted here that if you do not use the npm run test local command, an error will be reported.
Insert image description here

Guess you like

Origin blog.csdn.net/wangbiao9292/article/details/129277754