Skip to content

nicojs/jest-find-related-tests-roots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐛 Bug Report

Using --findRelatedTest doesn't seem to be compatible with specifying roots.

To Reproduce

Steps to reproduce the behavior:

  1. Make sure your tests are located in a different directory than your main code:
    ├── package-lock.json
    ├── package.json
    ├── src
    │   └── example.js
    └── test
        └── example.test.js
    
  2. Configure roots to point to your test dir
    {
        "jest": {
          "roots": ["test"]
        }
    }
  3. Run npx jest --findRelatedTests src/example.js and see the following:
    No tests found, exiting with code 1
    Run with `--passWithNoTests` to exit with code 0
    No files found in ~/github/jest-find-related-tests-roots.
    Make sure Jest's configuration does not exclude this directory.
    To set up Jest, make sure a package.json file exists.
    Jest Documentation: https://jestjs.io/docs/configuration
    Pattern: src/example.js - 0 matches
    

Expected behavior

 PASS  test/example.test.js
  ✓ should provide 42 (2 ms)

Link to repl or repo (highly encouraged)

See https://github.com/nicojs/jest-find-related-tests-roots for an example.

envinfo


  System:
    OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
  Binaries:
    Node: 14.16.1 - /usr/bin/node
    Yarn: 1.22.10 - /usr/bin/yarn
    npm: 6.14.12 - /usr/bin/npm
  npmPackages:
    jest: ^27.0.4 => 27.0.4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published