Skip to content

Commit 12c307b

Browse files
committed
fix(scripts/pre-commit): don't fail when no related tests are found
1 parent a5d4057 commit 12c307b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/config/helpers/build-lint-staged.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const {resolveHoverScripts, resolveBin} = require('../../utils')
33
const hoverScripts = resolveHoverScripts()
44
const doctoc = resolveBin('doctoc')
55

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

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

src/scripts/__tests__/__snapshots__/pre-commit.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Array [
1717
exports[`pre-commit disables DocToc and forwards args 2`] = `
1818
Array [
1919
.test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json,
20-
{"*.+(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"]},
20+
{"*.+(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"]},
2121
]
2222
`;
2323

0 commit comments

Comments
 (0)