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

Dependency updates and so forth #3202

Merged
merged 10 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: npm install --global npm@^8
- run: npm install --no-audit
- run: npm run cover
- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v3
with:
files: coverage/lcov.info
name: ${{ matrix.os }}/${{ matrix.node-version }}
Expand All @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ts-version: [~4.7, ~4.8, ~4.9]
ts-version: [~4.7, ~4.8, ~4.9, ~5.0]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -66,8 +66,6 @@ jobs:
with:
node-version-file: package.json
cache: npm
- name: Pin npm
run: npm install --global npm@9.3.0
- run: npm install --no-audit
- name: Test package-lock for unexpected modifications
run: |
Expand Down
4 changes: 2 additions & 2 deletions lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class AssertionError extends Error {
}

export function checkAssertionMessage(assertion, message) {
if (typeof message === 'undefined' || typeof message === 'string') {
if (message === undefined || typeof message === 'string') {
return true;
}

Expand Down Expand Up @@ -253,7 +253,7 @@ function assertExpectations({assertion, actual, expectations, message, prefix, s
});
}

if (typeof expectations.code !== 'undefined' && actual.code !== expectations.code) {
if (expectations.code !== undefined && actual.code !== expectations.code) {
throw new AssertionError({
assertion,
message,
Expand Down
3 changes: 2 additions & 1 deletion lib/glob-helpers.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const process = require('node:process');

const ignoreByDefault = require('ignore-by-default');
const picomatch = require('picomatch');
const slash = require('slash');

const slash = require('./slash.cjs');

const defaultIgnorePatterns = [...ignoreByDefault.directories(), '**/node_modules'];
exports.defaultIgnorePatterns = defaultIgnorePatterns;
Expand Down
8 changes: 3 additions & 5 deletions lib/like-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ export function selectComparable(lhs, selector, circular = new Set()) {

const comparable = Array.isArray(selector) ? [] : {};
for (const [key, rhs] of Object.entries(selector)) {
if (isLikeSelector(rhs)) {
comparable[key] = selectComparable(Reflect.get(lhs, key), rhs, circular);
} else {
comparable[key] = Reflect.get(lhs, key);
}
comparable[key] = isLikeSelector(rhs)
? selectComparable(Reflect.get(lhs, key), rhs, circular)
: Reflect.get(lhs, key);
}

return comparable;
Expand Down
36 changes: 36 additions & 0 deletions lib/slash.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Inlined from
<https://github.com/sindresorhus/slash/blob/98b618f5a3bfcb5dd374b204868818845b87bb2f/index.js>,
since we need a CJS version.

Copyright 2023 Sindre Sorhus

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

function slash(path) {
const isExtendedLengthPath = path.startsWith('\\\\?\\');

if (isExtendedLengthPath) {
return path;
}

Check warning on line 31 in lib/slash.cjs

View check run for this annotation

Codecov / codecov/patch

lib/slash.cjs#L30-L31

Added lines #L30 - L31 were not covered by tests

return path.replace(/\\/g, '/');
}

module.exports = slash;
2 changes: 1 addition & 1 deletion lib/snapshot-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import cbor from 'cbor';
import concordance from 'concordance';
import indentString from 'indent-string';
import mem from 'mem';
import slash from 'slash';
import writeFileAtomic from 'write-file-atomic';

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

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