Skip to content

Commit

Permalink
fix(scripts/pre-commit): don't fail when no related tests are found
Browse files Browse the repository at this point in the history
  • Loading branch information
jrolfs committed Dec 9, 2022
1 parent a5d4057 commit 12c307b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/config/helpers/build-lint-staged.js
Expand Up @@ -3,7 +3,7 @@ const {resolveHoverScripts, resolveBin} = require('../../utils')
const hoverScripts = resolveHoverScripts()
const doctoc = resolveBin('doctoc')

const defaultTestCommand = `${hoverScripts} test --findRelatedTests`
const defaultTestCommand = `${hoverScripts} test --findRelatedTests --passWithNoTests`

const sourceExtensions = ['js', 'jsx', 'ts', 'tsx']

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/__tests__/__snapshots__/pre-commit.js.snap
Expand Up @@ -17,7 +17,7 @@ Array [
exports[`pre-commit disables DocToc and forwards args 2`] = `
Array [
.test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json,
{"*.+(js|jsx|json|json5|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx|vue)":["./src/index.js format"],"*.+(js|jsx|ts|tsx)":["./src/index.js lint"],"*.+(tsx|ts|jsx|js)":["./src/index.js test --findRelatedTests"]},
{"*.+(js|jsx|json|json5|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx|vue)":["./src/index.js format"],"*.+(js|jsx|ts|tsx)":["./src/index.js lint"],"*.+(tsx|ts|jsx|js)":["./src/index.js test --findRelatedTests --passWithNoTests"]},
]
`;

Expand Down

0 comments on commit 12c307b

Please sign in to comment.