Skip to content

Commit

Permalink
Merge pull request #58 from micromatch/github_actions
Browse files Browse the repository at this point in the history
Several improvements for GitHub Actions CI
  • Loading branch information
mrmlnc authored Jan 7, 2025
2 parents 19803f1 + 46fa25a commit f355674
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ on:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x]
os: [ ubuntu-latest, macos-latest, windows-latest ]

runs-on: ${{ matrix.os }}
node-version: [8.3.0, 8, 10, 12, 14, 16, 18, 20, 22]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"node": ">=8"
},
"scripts": {
"test": "mocha",
"test": "mocha -r ./test/mocha-initialization.js",
"benchmark": "node benchmark"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions test/braces.parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('braces.parse()', () => {
it('should return an AST', () => {
const ast = parse('a/{b,c}/d');
const brace = ast.nodes.find(node => node.type === 'brace');
assert(brace);
assert.ok(brace);
assert.equal(brace.nodes.length, 5);
});

Expand All @@ -30,7 +30,7 @@ describe('braces.parse()', () => {
const ast = parse('a/{a,b,[{c,d}]}/e');
const brace = ast.nodes[2];
const bracket = brace.nodes.find(node => node.value[0] === '[');
assert(bracket);
assert.ok(bracket);
assert.equal(bracket.value, '[{c,d}]');
});
});
Expand Down
17 changes: 17 additions & 0 deletions test/mocha-initialization.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @fileoverview
* This package works with node@8.3.0, which does not have support for `assert.strict`.
* This module is a shim to support these methods.
*
* @todo Remove this file when we drop support for node@8.3.0.
*/
const assert = require('assert');

if (assert.strict === undefined) {
assert.strict = {
ok: assert.ok,
equal: assert.equal,
deepEqual: assert.deepEqual,
throws: assert.throws,
};
}

0 comments on commit f355674

Please sign in to comment.