diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0cd44c535e9a..03782d03a3f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,7 +146,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16, 14, 12] + node-version: [16, 14, 12, 10, 8, 6] steps: - name: Checkout code uses: actions/checkout@v2 diff --git a/jest.config.js b/jest.config.js index f2f9746acce5..0a14737c1919 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,6 @@ const supportsESM = parseInt(process.versions.node) >= 12; +// These tests files are directly importing `src` files rather than the compiled versions const importsSrc = [ "packages/babel-parser/test/unit/tokenizer/types.js", "packages/babel-parser/test/unit/util/identifier.js", @@ -12,7 +13,7 @@ const importsSrc = [ ]; module.exports = { - runner: "./test/jest-light-runner", + ...(supportsESM && { runner: "./test/jest-light-runner" }), collectCoverageFrom: [ "packages/*/src/**/*.{js,mjs,ts}", @@ -36,7 +37,7 @@ module.exports = { "/build/", "/.history/", // local directory for VSCode Extension - https://marketplace.visualstudio.com/items?itemName=xyz.local-history "_browser\\.js", - ...importsSrc, + ...(supportsESM ? importsSrc : []), ], testEnvironment: "node", setupFilesAfterEnv: ["/test/testSetupFile.js"],