cli: disable parsing of input source maps in tests

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-10-08 12:38:15 +02:00
parent f91809d6f6
commit f0514c72c3
2 changed files with 9 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Disabled parsing of input source maps in the SWC transform for Jest.
+4 -1
View File
@@ -18,7 +18,10 @@ const { createTransformer: createSwcTransformer } = require('@swc/jest');
const ESM_REGEX = /\b(?:import|export)\b/;
function createTransformer(config) {
const swcTransformer = createSwcTransformer(config);
const swcTransformer = createSwcTransformer({
inputSourceMap: false,
...config,
});
const process = (source, filePath, jestOptions) => {
if (filePath.endsWith('.js') && !ESM_REGEX.test(source)) {
return { code: source };