用jest测试自定义扩展

时间:2017-06-12 09:24:41

标签: regex jest

我想测试所有.ut.js个文件。

请参阅下面我尝试过的内容和输出。我错过了什么?我测试了正则表达式,所以我知道这不是问题。

我还尝试传递标记testRegextestMatch并获取zsh: no matches found: ...

$ yarn jest '**\/*\.ut\.js'
yarn jest v0.24.6
$ "/home/goldylucks/apps/ci-workflow-workshop/node_modules/.bin/jest" **\/*\.ut\.js
  Invalid testPattern **/*.ut.js supplied. Running all tests instead.

$ yarn jest '**\/\.ut\.js'
yarn jest v0.24.6
$ "/home/goldylucks/apps/ci-workflow-workshop/node_modules/.bin/jest" **\/\.ut\.js
  Invalid testPattern **/.ut.js supplied. Running all tests instead.

$ yarn jest '\.ut\.js'
yarn jest v0.24.6
$ "/home/goldylucks/apps/ci-workflow-workshop/node_modules/.bin/jest" \.ut\.js
No tests found
In /home/goldylucks/apps/ci-workflow-workshop
  32 files checked.
  testMatch: **/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x) - 1 match
  testPathIgnorePatterns: /node_modules/ - 32 matches
Pattern: ".ut.js" - 0 matches
Done in 0.61s.

$ yarn jest '\.ut\.'  
yarn jest v0.24.6
$ "/home/goldylucks/apps/ci-workflow-workshop/node_modules/.bin/jest" \.ut\.
No tests found
In /home/goldylucks/apps/ci-workflow-workshop
  32 files checked.
  testMatch: **/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x) - 1 match
  testPathIgnorePatterns: /node_modules/ - 32 matches
Pattern: ".ut." - 0 matches
Done in 0.60s.

0 个答案:

没有答案
相关问题