Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop node < 18 #1731

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 7 additions & 32 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,19 @@ jobs:
node: 18.x
script: npm run test-nolint

- name: "Linux: Node 16"
# Includes 'firefox', 'chromium', and more.
# https://github.com/actions/virtual-environments/blob/ubuntu20/20220410.2/images/linux/Ubuntu2004-Readme.md
os: ubuntu-20.04
node: 16.x
# Run the lint step only once because, in March 2022, GitHub began
# automatically extracting ESLint warnings from build logs and turning them into
# checks shown inline in PR diffs, but doesn't de-duplicate these.
script: npm test
Krinkle marked this conversation as resolved.
Show resolved Hide resolved

- name: "Linux: Node 14"
os: ubuntu-20.04
node: 14.x
script: npm run test-nolint

- name: "Linux: Node 12"
os: ubuntu-20.04
node: 12.x
script: npm run test-nolint

- name: "Linux: Node 10"
os: ubuntu-20.04
node: 10.x
script: npm run test-nolint

- name: "Integration"
os: ubuntu-20.04
node: 16.x
node: 18.x
script: npm run test-integration

- name: "Windows: Node 16"
- name: "Windows: Node 18"
os: windows-latest
node: 16.x
node: 18.x
script: npm run test-nolint

- name: "macOS: Node 16"
- name: "macOS: Node 18"
os: macos-latest
node: 16.x
node: 18.x
script: npm run test-nolint

name: ${{ matrix.name }}
Expand Down Expand Up @@ -112,10 +87,10 @@ jobs:
~/.npm
${{ github.workspace }}/.puppeteer_download
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Use Node.js 16
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x
- name: Install mozjs
run: |
sudo apt-fast install -y libmozjs-68-dev
Expand Down
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
],
"main": "qunit/qunit.js",
"engines": {
"node": ">=10"
"node": ">=18"
},
"dependencies": {
"commander": "7.2.0",
Expand Down Expand Up @@ -80,8 +80,7 @@
"proxyquire": "^1.8.0",
"requirejs": "^2.3.6",
"rimraf": "^3.0.2",
"rollup": "^2.79.1",
"semver": "^7.3.8"
"rollup": "^2.79.1"
},
"scripts": {
"build": "rollup -c && grunt copy:src-css",
Expand Down
93 changes: 39 additions & 54 deletions test/cli/cli-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const expectedOutput = require('./fixtures/expected/tap-outputs');
const { execute, prettyPrintCommand, concurrentMapKeys } = require('./helpers/execute');
const semver = require('semver');

const skipOnWinTest = (process.platform === 'win32' ? 'skip' : 'test');

Expand Down Expand Up @@ -259,67 +258,53 @@ HOOK: BCD1 @ B after`;
assert.equal(execution.code, 0);
});

if (semver.gte(process.versions.node, '12.0.0')) {
QUnit.test('run ESM test suite with import statement', async assert => {
const command = ['qunit', '../../es2018/esm.mjs'];
const execution = await execute(command);

// Node 12 enabled ESM by default, without experimental flag,
// but left the warning in stderr. The warning was removed in Node 14.
// Don't bother checking stderr
const stderr = semver.gte(process.versions.node, '14.0.0') ? execution.stderr : '';
assert.equal(execution.code, 0);
assert.equal(stderr, '');
assert.equal(execution.stdout, getExpected(command));
});
}
QUnit.test('run ESM test suite with import statement', async assert => {
const command = ['qunit', '../../es2018/esm.mjs'];
const execution = await execute(command);
assert.equal(execution.code, 0);
assert.equal(execution.stderr, '');
assert.equal(execution.stdout, getExpected(command));
});

// https://nodejs.org/dist/v12.12.0/docs/api/cli.html#cli_enable_source_maps
if (semver.gte(process.versions.node, '14.0.0')) {
// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[skipOnWinTest]('normal trace with native source map', async assert => {
const command = ['qunit', 'sourcemap/source.js'];
const execution = await execute(command);
// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[skipOnWinTest]('normal trace with native source map', async assert => {
const command = ['qunit', 'sourcemap/source.js'];
const execution = await execute(command);

assert.equal(execution.snapshot, getExpected(command));
});
assert.equal(execution.snapshot, getExpected(command));
});

// skip if running in code coverage mode,
// as that leads to conflicting maps-on-maps that invalidate this test
//
// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[process.env.NYC_PROCESS_ID ? 'skip' : skipOnWinTest](
'mapped trace with native source map', async function (assert) {
const command = ['qunit', 'sourcemap/source.min.js'];
const execution = await execute(command, {
env: { NODE_OPTIONS: '--enable-source-maps' }
});

assert.equal(execution.snapshot, getExpected(command));
// skip if running in code coverage mode,
// as that leads to conflicting maps-on-maps that invalidate this test
//
// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[process.env.NYC_PROCESS_ID ? 'skip' : skipOnWinTest](
'mapped trace with native source map', async function (assert) {
const command = ['qunit', 'sourcemap/source.min.js'];
const execution = await execute(command, {
env: { NODE_OPTIONS: '--enable-source-maps' }
});
}

// https://nodejs.org/docs/v14.0.0/api/v8.html#v8_v8_getheapsnapshot
// Created in Node 11.x, but starts working the way we need from Node 14.
if (semver.gte(process.versions.node, '14.0.0')) {
QUnit.test('memory-leak/module-closure [unfiltered]', async assert => {
const command = ['node', '--expose-gc', '../../../bin/qunit.js', 'memory-leak/module-closure.js'];
const execution = await execute(command);
assert.equal(execution.snapshot, getExpected(command));
});

QUnit.test('memory-leak/module-closure [filtered module]', async assert => {
const command = ['node', '--expose-gc', '../../../bin/qunit.js', '--filter', '!child', 'memory-leak/module-closure.js'];
const execution = await execute(command);
assert.equal(execution.snapshot, getExpected(command));
});

QUnit.test('memory-leak/test-object', async assert => {
const command = ['node', '--expose-gc', '../../../bin/qunit.js', 'memory-leak/test-object.js'];
const execution = await execute(command);
assert.equal(execution.snapshot, getExpected(command));
});
}
QUnit.test('memory-leak/module-closure [unfiltered]', async assert => {
const command = ['node', '--expose-gc', '../../../bin/qunit.js', 'memory-leak/module-closure.js'];
const execution = await execute(command);
assert.equal(execution.snapshot, getExpected(command));
});

QUnit.test('memory-leak/module-closure [filtered module]', async assert => {
const command = ['node', '--expose-gc', '../../../bin/qunit.js', '--filter', '!child', 'memory-leak/module-closure.js'];
const execution = await execute(command);
assert.equal(execution.snapshot, getExpected(command));
});

QUnit.test('memory-leak/test-object', async assert => {
const command = ['node', '--expose-gc', '../../../bin/qunit.js', 'memory-leak/test-object.js'];
const execution = await execute(command);
assert.equal(execution.snapshot, getExpected(command));
});

// TODO: Workaround fact that child_process.spawn() args array is a lie on Windows.
// https://github.com/nodejs/node/issues/29532
Expand Down