diff --git a/.changeset/good-lobsters-search.md b/.changeset/good-lobsters-search.md new file mode 100644 index 0000000..8d8bcc3 --- /dev/null +++ b/.changeset/good-lobsters-search.md @@ -0,0 +1,5 @@ +--- +"@swc/jest": patch +--- + +Return es2018 in the event that process.version is undefined. diff --git a/packages/jest/index.ts b/packages/jest/index.ts index d9bf340..21684c2 100644 --- a/packages/jest/index.ts +++ b/packages/jest/index.ts @@ -144,7 +144,7 @@ function buildSwcTransformOpts( computedSwcOptions, "jsc.target", // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - nodeTargetDefaults.get(process.version.match(/v(\d+)/)![1]) || + nodeTargetDefaults.get(process.version?.match(/v(\d+)/)![1]) || "es2018" ); }