Skip to content

Commit

Permalink
Assorted updates
Browse files Browse the repository at this point in the history
* Remove Node.js 17 support
* Add Node.js 18 support
* Use latest everything for CI tasks
* Configure Volta for managing development versions
* Update dependencies
  • Loading branch information
novemberborn committed Jun 2, 2022
1 parent b208d14 commit 6240393
Show file tree
Hide file tree
Showing 25 changed files with 1,083 additions and 1,415 deletions.
49 changes: 22 additions & 27 deletions .github/workflows/ci.yml
Expand Up @@ -15,22 +15,21 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [^12.22, ^14.17, ^16.4, ^17]
node-version: [^12.22, ^14.17, ^16.4, ^18]
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Enable symlinks
if: matrix.os == 'windows-latest'
run: |
git config core.symlinks true
git reset --hard
- run: rm .npmrc
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Upgrade npm
run: npm install --global npm@^8.1.2
run: npm install --global npm@^8.12
- run: npm install --no-audit
- run: npm run cover
- uses: codecov/codecov-action@v2
Expand All @@ -45,14 +44,13 @@ jobs:
matrix:
ts-version: [~4.4, ~4.5, ~4.6, ~4.7]
steps:
- uses: actions/checkout@v2
- run: rm .npmrc
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ^12.22
node-version: ^18
cache: npm
- name: Upgrade npm
run: npm install --global npm@^8.1.2
run: npm install --global npm@^8.12
- run: npm install --no-audit
- run: npm i typescript@${TS_VERSION}
env:
Expand All @@ -65,15 +63,14 @@ jobs:
name: Test package-lock for unexpected modifications
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rm .npmrc
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ^12.22
node-version: ^18
cache: npm
- name: Upgrade npm
run: if [[ "$(npm -v)" != "8.1.2" ]]; then npm install --global npm@8.1.2; fi
- run: npm install --no-audit --lockfile-version=3
run: if [[ "$(npm -v)" != "8.12.0" ]]; then npm install --global npm@8.12.0; fi
- run: npm install --no-audit
- name: Test package-lock for unexpected modifications
run: |
npm -v
Expand All @@ -88,27 +85,25 @@ jobs:
name: Install dependencies without using a lockfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rm .npmrc
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ^12.22
node-version: ^18
- name: Upgrade npm
run: npm install --global npm@^8.1.2
- run: npm install --no-shrinkwrap --no-audit
run: npm install --global npm@^8.12
- run: npm install --no-package-lock --no-audit
- run: npm run cover

xo:
name: Lint source files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rm .npmrc
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ^16.4
node-version: ^18
cache: npm
- name: Upgrade npm
run: npm install --global npm@^8.1.2
run: npm install --global npm@^8.12
- run: npm install --no-audit
- run: npx xo
9 changes: 2 additions & 7 deletions lib/reporters/default.js
Expand Up @@ -231,7 +231,7 @@ export default class Reporter {
}

case 'hook-finished': {
if (true && event.logs.length > 0) {
if (event.logs.length > 0) {
this.lineWriter.writeLine(` ${this.prefixTitle(event.testFile, event.title)}`);
this.writeLogs(event);
}
Expand Down Expand Up @@ -312,7 +312,7 @@ export default class Reporter {
this.filesWithoutMatchedLineNumbers.add(event.testFile);

this.lineWriter.writeLine(colors.error(`${figures.cross} Line numbers for ${this.relativeFile(event.testFile)} did not match any tests`));
} else if (true && !this.failFastEnabled && fileStats.remainingTests > 0) {
} else if (!this.failFastEnabled && fileStats.remainingTests > 0) {
this.lineWriter.writeLine(colors.error(`${figures.cross} ${fileStats.remainingTests} ${plur('test', fileStats.remainingTests)} remaining in ${this.relativeFile(event.testFile)}`));
}
}
Expand Down Expand Up @@ -571,17 +571,12 @@ export default class Reporter {
this.lineWriter.writeLine();

if (this.failures.length > 0) {
const writeTrailingLines = this.internalErrors.length > 0 || this.sharedWorkerErrors.length > 0 || this.uncaughtExceptions.length > 0 || this.unhandledRejections.length > 0;

const lastFailure = this.failures[this.failures.length - 1];
for (const event of this.failures) {
this.writeFailure(event);
if (event !== lastFailure) {
this.lineWriter.writeLine();
this.lineWriter.writeLine();
} else if (!true && writeTrailingLines) {
this.lineWriter.writeLine();
this.lineWriter.writeLine();
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/runner.js
Expand Up @@ -524,7 +524,7 @@ export default class Runner extends Emittery {
// If a concurrent test fails, even if `failFast` is enabled it won't
// stop other concurrent tests from running.
const allOkays = await Promise.all(concurrentTests.map(task => this.runTest(task, contextRef.copy())));
return allOkays.every(ok => ok);
return allOkays.every(Boolean);
});

const beforeExitHandler = this.beforeExitHandler.bind(this);
Expand Down

0 comments on commit 6240393

Please sign in to comment.