From 217547ae51d829329ed7e560eaa0f3d668d47f36 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 13 Mar 2022 17:23:59 +0100 Subject: [PATCH] cli: fix test file matching Signed-off-by: Patrik Oldsberg --- .changeset/great-pots-fetch.md | 5 +++++ packages/cli/config/jest.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/great-pots-fetch.md diff --git a/.changeset/great-pots-fetch.md b/.changeset/great-pots-fetch.md new file mode 100644 index 0000000000..34785dfb7f --- /dev/null +++ b/.changeset/great-pots-fetch.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': minor +--- + +**BREAKING**: The provided Jest configuration now only matches files with a `.test.` infix, rather than any files that is suffixed with `test.`. In particular this means that files named just `test.ts` will no longer be considered a test file. diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index d5b85b9748..1472260e33 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -112,7 +112,7 @@ async function getProjectConfig(targetPath, displayName) { }, // A bit more opinionated - testMatch: ['**/?(*.)test.{js,jsx,ts,tsx,mjs,cjs}'], + testMatch: ['**/*.test.{js,jsx,ts,tsx,mjs,cjs}'], transformIgnorePatterns: [`/node_modules/(?:${transformIgnorePattern})/`], };