首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jest的测试匹配没有选择我的测试文件

Jest的测试匹配没有选择我的测试文件
EN

Stack Overflow用户
提问于 2019-07-05 15:09:36
回答 1查看 2.4K关注 0票数 0

嘿,我不能让testMatch去拿我的测试文件。这是我的配置:

代码语言:javascript
复制
module.exports = {
    preset: 'jest-puppeteer',
    testMatch: [
        '**/tests/**/?(*.)+spec.js'
    ]
};

我的目录布局:

代码语言:javascript
复制
- Automation
    -  jest.config.js
    - tests
        - single-property
            - index.spec.js

输出:

代码语言:javascript
复制
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In C:\Users\<user_name>\WebstormProjects\Automation
  4 files checked.
  testMatch: **/tests/**/?(*.)+spec.js - 0 matches
  testPathIgnorePatterns: \\node_modules\\ - 4 matches
  testRegex:  - 0 matches
Pattern:  - 0 matches
EN

回答 1

Stack Overflow用户

发布于 2019-07-05 20:50:17

尝试如下所示:

'**/tests/**/*.spec.js'

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56898168

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档