我正在尝试在我的打字稿应用程序中使用 jest。
当我运行命令 jest 时,它工作正常。
yarn run v1.17.3
$ jest --coverage --verbose
C:\Users\hasee\Documents\Repository\c0-compiler>"node" "C:\Users\hasee\Documents\Repository\c0-compiler\node_modules\.bin\\..\_jest@24.9.0@jest\bin\jest.js"
--coverage --verbose
PASS tests/sum.test.ts (6.432s)
? add (3ms)
----------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files | 100 | 100 | 100 | 100 | |
sum.ts | 100 | 100 | 100 | 100 | |
----------|----------|----------|----------|----------|-------------------|
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total …Run Code Online (Sandbox Code Playgroud)