Skip to content

Commit

Permalink
[Tests] run core-js tests on v2 and v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed May 8, 2021
1 parent ed3445b commit aaa111d
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 23 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/node-4+.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ jobs:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
include:
- node-version: 'lts/*'
COREJS: 2
- node-version: '0.12'
COREJS: 2
- node-version: '0.10'
COREJS: 2

steps:
- uses: actions/checkout@v2
Expand Down
59 changes: 56 additions & 3 deletions .github/workflows/node-iojs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
versionsAsRoot: true
preset: 'iojs'

latest:
Expand All @@ -21,7 +22,8 @@ jobs:

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.latest) }}
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}

steps:
- uses: actions/checkout@v2
Expand All @@ -32,6 +34,30 @@ jobs:
skip-ls-check: true
- run: npm run tests-only
- uses: codecov/codecov-action@v1

latest-corejs:
needs: [matrix]
name: 'latest minors (core-js)'
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
COREJS:
- 3
- 2

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
after_install: npm install --no-save core-js@${{ matrix.COREJS }}
skip-ls-check: true
- run: npm run test:corejs
- uses: codecov/codecov-action@v1

minors:
needs: [matrix, latest]
Expand All @@ -42,21 +68,48 @@ jobs:

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.minors) }}
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.minors) }}

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
skip-ls-check: true
- run: npm run tests-only
- uses: codecov/codecov-action@v1

minors-corejs:
needs: [matrix, latest]
name: 'non-latest minors (core-js)'
continue-on-error: true
if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.minors) }}
COREJS:
- 3
- 2

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
after_install: npm install --no-save core-js@${{ matrix.COREJS }}
skip-ls-check: true
- run: npm run tests-only
- uses: codecov/codecov-action@v1

node:
name: 'io.js'
needs: [latest, minors]
needs: [latest, minors, latest-corejs, minors-corejs]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
17 changes: 13 additions & 4 deletions .github/workflows/node-zero.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
versionsAsRoot: true
preset: '0.x'

stable:
Expand All @@ -21,7 +22,11 @@ jobs:

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.stable) }}
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.stable) }}
command:
- 'tests-only'
- 'test:corejs'

steps:
- uses: actions/checkout@v2
Expand All @@ -31,7 +36,7 @@ jobs:
node-version: ${{ matrix.node-version }}
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
skip-ls-check: true
- run: npm run tests-only
- run: npm run ${{ matrix.command }}
- uses: codecov/codecov-action@v1

unstable:
Expand All @@ -43,7 +48,11 @@ jobs:

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.unstable) }}
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.unstable) }}
command:
- 'tests-only'
- 'test:corejs'

steps:
- uses: actions/checkout@v2
Expand All @@ -53,7 +62,7 @@ jobs:
node-version: ${{ matrix.node-version }}
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
skip-ls-check: true
- run: npm run tests-only
- run: npm run ${{ matrix.command }}
- uses: codecov/codecov-action@v1

node:
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ coverage/
.nyc_output/

.github/workflows

test-corejs.js
1 change: 1 addition & 0 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"exclude": [
"coverage",
"test",
"test-corejs.js",
"getCollectionsForEach.js",
"getSymbolIterator.js"
]
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"pretest": "npm run --silent lint",
"test": "npm run tests-only",
"posttest": "aud --production",
"test:corejs": "nyc tape test-corejs.js",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only && npm run test:corejs",
"posttest": "aud --production",
"lint": "eslint ."
},
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions test-corejs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

require('core-js');

require('./test/why');

require('./test/native');
7 changes: 0 additions & 7 deletions test/corejs.js

This file was deleted.

0 comments on commit aaa111d

Please sign in to comment.