diff --git a/extensions/ql-vscode/test/jest-config.ts b/extensions/ql-vscode/test/jest-config.ts index 6f25adc34..ab0b72243 100644 --- a/extensions/ql-vscode/test/jest-config.ts +++ b/extensions/ql-vscode/test/jest-config.ts @@ -1,4 +1,26 @@ -export const transformIgnorePatterns = [ - // These use ES modules, so need to be transformed - "node_modules/(?!(?:@vscode/webview-ui-toolkit|@microsoft/.+|@octokit/.+|before-after-hook|d3|d3-(.*)|delaunator|exenv-es6|internmap|nanoid|p-queue|p-timeout|robust-predicates|universal-user-agent)/.*)", +// These are all the packages that DO need to be transformed. All other packages will be ignored. +// These pacakges all use ES modules, so need to be transformed +const transformScopes = ["@microsoft", "@octokit"]; +const transformPackages = [ + "@vscode/webview-ui-toolkit", + "before-after-hook", + "d3", + "delaunator", + "exenv-es6", + "internmap", + "nanoid", + "p-queue", + "p-timeout", + "robust-predicates", + "universal-user-agent", +]; +const transformWildcards = ["d3-(.*)"]; +const transformPatterns = [ + ...transformScopes.map((scope) => `${scope}/.+`), + ...transformPackages, + ...transformWildcards, +]; + +export const transformIgnorePatterns = [ + `node_modules/(?!(?:${transformPatterns.join("|")})/.*)`, ];