Skip to content

jest <regexForTestFiles> CLI not picking up tests #5740

@MadLittleMods

Description

@MadLittleMods

jest <regexForTestFiles> CLI not picking up tests.

Perhaps related to #5582

What is the current behavior?

Barebones demo repo: https://gitlab.com/MadLittleMods/jest-test-regex-issue-barebones-test-case1

Reproduction steps
  1. Install jest@22.4.2
  2. Save a file with some tests in some-test.js
  3. jest some-test.js
  4. Notice, No tests found
$ jest some-test.js
No tests found
In /jest-test-regex1
  3 files checked.
  testMatch: **/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x) - 0 matches
  testPathIgnorePatterns: /node_modules/ - 3 matches
Pattern: some-test.js - 0 matches

What is the expected behavior?

The jest <regexForTestFiles> CLI syntax should match files regardless of testMatch config.


This previously worked with jest@22.3.0 but I am unable to downgrade successfully and confirm because it always installs jest-cli@22.4.2. Any tips? Related #405, #3391

This installs jest@22.3.0 and jest-cli@22.3.0 but throws other errors

$ npm install jest@22.3.0 && cd ./node_modules/jest && rm -rf ./node_modules/jest-cli && npm install jest-cli@22.3.0 && cd ../../

$ npm test

TypeError: (0 , (_jestUtil || _load_jestUtil(...)).validateCLIOptions) is not a function
    at buildArgv (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:133:58)
    at Object.<anonymous> (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:41:20)
    at Generator.next (<anonymous>)
    at step (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:53:2732)
    at /jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:53:2962
    at new Promise (<anonymous>)
    at Object.<anonymous> (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:53:2643)
    at Object.run (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:53:48)
    at Object.<anonymous> (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/bin/jest.js:16:27)
    at Module._compile (module.js:643:30)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions