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.

Configuration file equivalent for --passWithNoTests flag

See original GitHub issue

🚀 Feature Proposal

Add a passWithNoTests boolean support in the configuration file, to have the same effect as the --passWithNoTests CLI flag.

Motivation

We currently use a shared configuration file across our organization, so that every repo running Jest will have the same default configuration (we do the same for Prettier, TSLint, Webpack, etc.). This ensures consistency, avoids surprises, and lets our teams have a sort of internal “zero conf” set up with the preferences/settings of the engineering organization.

This works really well with Jest, except we are now adding --passWithNoTests to all our new repos, where a configuration file equivalent would let us do it once.

Example

In jest.config.js (if using the JS format):

module.exports = {
  preset: 'ts-jest',
  moduleFileExtensions: ['ts', 'tsx', 'js'],
  globals: { 'ts-jest': { tsConfig: 'tsconfig.json' } },
  testMatch: ['**/test/**/*.test.(ts|tsx)'],
  // ...
  passWithNoTests: true,
};

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:54
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

38reactions
eladchencommented, Jun 20, 2020

So… That is not going to happen?

11reactions
Mark1626commented, Sep 3, 2019

@SimenB I can pick this up, if this feature is needed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Jest
You can use --config flag to pass an explicit path to the file. note. Keep in mind that the resulting configuration object must...
Read more >
Jest CLI Options - w3resource
This option will be the CLI equivalent of the projects configuration option. Note, if configuration files are found in the specified paths, all ......
Read more >
Test specific file using Jest - Stack Overflow
js will search any child folders from your project root directory, or where jest.config.js at; and match & test the specific test file....
Read more >
@nrwl/jest:jest | Nx
It is also helpful to have passWithNoTests: true set so your project doesn't ... The path to a Jest config file specifying how...
Read more >
Dynamically matching files in Jest | by Romain Kelifa - Medium
by default, Jest will look for a configuration file named ... --config jest.config.integration.only.js --passWithNoTests""test": "yarn jest ...
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