【发布时间】:2021-01-01 13:19:32
【问题描述】:
由于某种奇怪的原因,我无法运行我的笑话测试。我在这里错过了什么吗?
我已经尝试过 __test__ 和 __tests__
文件夹结构:
Package.json:
"scripts": {
"start": "ts-node-dev --poll src/index.ts",
"test": "jest watchAll --no-cache"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"setupFilesAfterEnv": [
"./src/test/setup.ts"
]
},
错误:
> auth@1.0.0 test E:\cultor-microservices\auth
> jest watchAll --no-cache
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In E:\cultor-microservices\auth
15 files checked.
testMatch: **/__tests__/**/*.[jt]s?(x), **/?(*.)+(spec|test).[tj]s?(x) - 1 match
testPathIgnorePatterns: \\node_modules\\ - 15 matches
testRegex: - 0 matches
Pattern: watchAll - 0 matches
【问题讨论】:
-
您可以在输出中看到它要查找的内容:
**/__tests__/**/*.[jt]s?(x), **/?(*.)+(spec|test).[tj]s?(x)。__tests__应该可以工作,__test__不会,所以给minimal reproducible example 一些应该可以工作的东西。
标签: node.js typescript unit-testing jestjs ts-jest