Skip to content

Commit

Permalink
TODO: skip failing packages
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jul 11, 2022
1 parent 4c8770b commit 8a51cdc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jest.config.js
@@ -1,3 +1,4 @@
const fs = require("fs");
const semver = require("semver");
const nodeVersion = process.versions.node;
const supportsESMAndJestLightRunner = semver.satisfies(
Expand All @@ -8,6 +9,12 @@ const supportsESMAndJestLightRunner = semver.satisfies(
);
const isPublishBundle = process.env.IS_PUBLISH;

let LIB_USE_ESM = false;
try {
const type = fs.readFileSync(`${__dirname}/.module-type`, "utf-8").trim();
LIB_USE_ESM = type === "module";
} catch (_) {}

module.exports = {
runner: supportsESMAndJestLightRunner ? "jest-light-runner" : "jest-runner",

Expand Down Expand Up @@ -36,6 +43,9 @@ module.exports = {
// Some tests require internal files of bundled packages, which are not available
// in production builds. They are marked using the .skip-bundled.js extension.
...(isPublishBundle ? ["\\.skip-bundled\\.js$"] : []),
...(LIB_USE_ESM
? ["/babel-node/", "/babel-register/", "/babel-helpers/"]
: []),
],
testEnvironment: "node",
transformIgnorePatterns: [
Expand Down

0 comments on commit 8a51cdc

Please sign in to comment.