Skip to content

Commit

Permalink
fix skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
Eomm committed Sep 6, 2021
1 parent dc49760 commit aab5299
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/package-manager-ci.yml
Expand Up @@ -50,18 +50,20 @@ jobs:
run: |
npm install -g yarn
yarn set version berry && yarn set version 2.4.2
echo "nodeLinker: node-modules" >> .yarnrc.yml
echo "nodeLinker: pnp
pnpMode: loose
packageExtensions:
debug@*:
dependencies:
supports-color: "*"" >> .yarnrc.yml
# see https://github.com/yarnpkg/berry/issues/2935#issuecomment-911299992
yarn add --dev typescript@~4.3.2
yarn install
env:
# needed due the yarn.lock file in pino's .gitignore
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: Tests
run: |
# yarn doesn't support ESM yet
mv ./test/esm/index.test.js ./test/esm/index.test.skip.js
yarn run test-ci
run: yarn run test-ci

yarn-pnp:
name: yarn-pnp package manager on ${{ matrix.node-version }} ${{ matrix.os }}
Expand Down
6 changes: 4 additions & 2 deletions test/esm/index.test.js
Expand Up @@ -3,7 +3,9 @@
const t = require('tap')
const semver = require('semver')

if (!semver.satisfies(process.versions.node, '^13.3.0 || ^12.10.0 || >= 14.0.0')) {
const { isYarnPnp } = require('../helper')

if (!semver.satisfies(process.versions.node, '^13.3.0 || ^12.10.0 || >= 14.0.0') || isYarnPnp) {
t.skip('Skip esm because not supported by Node')
} else {
// Node v8 throw a `SyntaxError: Unexpected token import`
Expand All @@ -17,7 +19,7 @@ if (!semver.satisfies(process.versions.node, '^13.3.0 || ^12.10.0 || >= 14.0.0')
})
}

if (!semver.satisfies(process.versions.node, '>= 14.13.0 || ^12.20.0')) {
if (!semver.satisfies(process.versions.node, '>= 14.13.0 || ^12.20.0') || isYarnPnp) {
t.skip('Skip named exports because not supported by Node')
} else {
// Node v8 throw a `SyntaxError: Unexpected token import`
Expand Down

0 comments on commit aab5299

Please sign in to comment.