Skip to content

Commit 784ca4c

Browse files
authored
Dependency updates and so forth
* Test against [email protected] * Default to Node.js 20 * Upgrade XO * Add reporter logs for Node.js 20 * Update dev dependencies * Reduce timeouts in reporter tests This may cause CI failures especially on Windows, but we do waste a lot of time with these tests. * Inline slash dependency We need it available in CJS but the package is now ESM only. It's more bothersome to remember to not upgrade the dependency than to inline it. * Update dependencies * Rebuild lockfile * Use latest Codecov action
1 parent 5558367 commit 784ca4c

30 files changed

+2154
-945
lines changed

.github/workflows/ci.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: npm install --global npm@^8
3434
- run: npm install --no-audit
3535
- run: npm run cover
36-
- uses: codecov/codecov-action@v2
36+
- uses: codecov/codecov-action@v3
3737
with:
3838
files: coverage/lcov.info
3939
name: ${{ matrix.os }}/${{ matrix.node-version }}
@@ -43,7 +43,7 @@ jobs:
4343
runs-on: ubuntu-latest
4444
strategy:
4545
matrix:
46-
ts-version: [~4.7, ~4.8, ~4.9]
46+
ts-version: [~4.7, ~4.8, ~4.9, ~5.0]
4747
steps:
4848
- uses: actions/checkout@v3
4949
- uses: actions/setup-node@v3
@@ -66,8 +66,6 @@ jobs:
6666
with:
6767
node-version-file: package.json
6868
cache: npm
69-
- name: Pin npm
70-
run: npm install --global [email protected]
7169
- run: npm install --no-audit
7270
- name: Test package-lock for unexpected modifications
7371
run: |

lib/assert.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class AssertionError extends Error {
5555
}
5656

5757
export function checkAssertionMessage(assertion, message) {
58-
if (typeof message === 'undefined' || typeof message === 'string') {
58+
if (message === undefined || typeof message === 'string') {
5959
return true;
6060
}
6161

@@ -253,7 +253,7 @@ function assertExpectations({assertion, actual, expectations, message, prefix, s
253253
});
254254
}
255255

256-
if (typeof expectations.code !== 'undefined' && actual.code !== expectations.code) {
256+
if (expectations.code !== undefined && actual.code !== expectations.code) {
257257
throw new AssertionError({
258258
assertion,
259259
message,

lib/glob-helpers.cjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ const process = require('node:process');
44

55
const ignoreByDefault = require('ignore-by-default');
66
const picomatch = require('picomatch');
7-
const slash = require('slash');
7+
8+
const slash = require('./slash.cjs');
89

910
const defaultIgnorePatterns = [...ignoreByDefault.directories(), '**/node_modules'];
1011
exports.defaultIgnorePatterns = defaultIgnorePatterns;

lib/like-selector.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ export function selectComparable(lhs, selector, circular = new Set()) {
2424

2525
const comparable = Array.isArray(selector) ? [] : {};
2626
for (const [key, rhs] of Object.entries(selector)) {
27-
if (isLikeSelector(rhs)) {
28-
comparable[key] = selectComparable(Reflect.get(lhs, key), rhs, circular);
29-
} else {
30-
comparable[key] = Reflect.get(lhs, key);
31-
}
27+
comparable[key] = isLikeSelector(rhs)
28+
? selectComparable(Reflect.get(lhs, key), rhs, circular)
29+
: Reflect.get(lhs, key);
3230
}
3331

3432
return comparable;

lib/slash.cjs

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Inlined from
3+
<https://github.com/sindresorhus/slash/blob/98b618f5a3bfcb5dd374b204868818845b87bb2f/index.js>,
4+
since we need a CJS version.
5+
6+
Copyright 2023 Sindre Sorhus
7+
8+
Permission is hereby granted, free of charge, to any person obtaining a copy of
9+
this software and associated documentation files (the “Software”), to deal in
10+
the Software without restriction, including without limitation the rights to
11+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12+
the Software, and to permit persons to whom the Software is furnished to do so,
13+
subject to the following conditions:
14+
15+
The above copyright notice and this permission notice shall be included in all
16+
copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24+
*/
25+
26+
function slash(path) {
27+
const isExtendedLengthPath = path.startsWith('\\\\?\\');
28+
29+
if (isExtendedLengthPath) {
30+
return path;
31+
}
32+
33+
return path.replace(/\\/g, '/');
34+
}
35+
36+
module.exports = slash;

lib/snapshot-manager.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import cbor from 'cbor';
1010
import concordance from 'concordance';
1111
import indentString from 'indent-string';
1212
import mem from 'mem';
13-
import slash from 'slash';
1413
import writeFileAtomic from 'write-file-atomic';
1514

1615
import {snapshotManager as concordanceOptions} from './concordance-options.js';
16+
import slash from './slash.cjs';
1717

1818
// Increment if encoding layout or Concordance serialization versions change. Previous AVA versions will not be able to
1919
// decode buffers generated by a newer version, so changing this value will require a major version bump of AVA itself.

0 commit comments

Comments
 (0)