Common techniques and commands for Vue jest unit testing

Skill

Running only a certain test can speed up the process

it.only 

For example
Insert image description here
, to skip a certain test, you can use it during emergency release.

it.skip

For example

Insert image description here

Order

Run a test file

npm run ut "测试⽂件的地址"

Run a test file and monitor it. If there are any changes, automatically run the unit test again.

npm run ut:watch "测试⽂件的地址"

View test coverage

npm run ut:coverage

Listen + View test coverage

npm run ut:wc --path=你的地址,去掉src/和后缀

Guess you like

Origin blog.csdn.net/weixin_44872023/article/details/121849283