From dd5ea4ffe9d12c844b5ebbb92e68ac71703f2a25 Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Tue, 10 May 2022 23:48:26 -0400 Subject: [PATCH] Passing --passWithNoTests to jest linter (#17635) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Related to forem/forem#17612 Related to forem/forem#17634 Looking at the following error, I *think* this might address the observed issue. ```shell ✖ jest --findRelatedTests: No tests found, exiting with code 1 Run with `--passWithNoTests` to exit with code 0 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 ``` --- .lintstagedrc.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.lintstagedrc.js b/.lintstagedrc.js index cb76af735f1dc..a0eb3c8eefe0f 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -7,7 +7,11 @@ module.exports = { ], '*.scss': ['prettier --write'], '*.svg': ['svgo --pretty'], - '*.{js,jsx}': ['prettier --write', 'eslint --fix', 'jest --findRelatedTests'], + '*.{js,jsx}': [ + 'prettier --write', + 'eslint --fix', + 'jest --findRelatedTests --passWithNoTests', + ], './Gemfile': [ 'bundle exec rubocop --require rubocop-rspec --auto-correct --enable-pending-cops', ],