question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI --testPathPattern pattern format

See original GitHub issue

💬 Questions and Help

I have 2 types of tests:

  • unit tests *.test.js
  • tests with puppeteer *.test.pup.js

I try to run puppeteer tests with different command, so I try to run jest with

jest --testPathPattern="**/?(*.)+test.pup.js"

but jest do not find any test

Starting script: test-watch
  Invalid testPattern **\\?(*.)+(spec|test).js?(x) supplied. Running all tests instead.
No tests found related to files changed since last commit.

I even try jest’s pattern

jest --testPathPattern="**/?(*.)+(spec|test).js?(x)"

it also do not find any tests even adding into jest config

testMatch: ['**/__tests__/**/*.js?(x)', '**/?(*.)+(spec|test).js?(x)', '**/?(*.)+test.pup.js?(x)'],

doesn’t help - jest doesnt run test App.test.pup.js after it’s modification

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

18reactions
Diokuzcommented, Jun 23, 2018

@budarin you are trying to use glob, but testPathPattern is a regexp. Just remove **/?(*.)+ part.

0reactions
github-actions[bot]commented, May 22, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest CLI Options
A single or array of regexp pattern strings that are tested against all tests paths before executing the test. Contrary to --testPathPattern , ......
Read more >
jest how set file pattern in package.json script - Stack Overflow
Use the testRegex parameter in your jest config to set a filename pattern: testRegex: ...
Read more >
Jest CLI Options - w3resource
--testPathPattern=<regex>​​ This is a regexp pattern string that is matched against all tests paths before executing the test. On Windows, you ...
Read more >
nrwl-nx/community - Gitter
Hey everyone. I'm currently trying to run some tests in my new repo for just a few files matching a name pattern. Pretty...
Read more >
Full Name Patterns (GNU Findutils 4.9.0)
Test: -path pattern; Test: -wholename pattern. True if the entire file name, starting with the command line argument under which the file was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found