diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bfca8a01..3200ca75 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.26.0" + ".": "4.26.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 12cad69a..c01906e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [4.26.1](https://github.com/npm/template-oss/compare/v4.26.0...v4.26.1) (2025-10-20) +### Bug Fixes +* [`eeb4266`](https://github.com/npm/template-oss/commit/eeb426620b7145cfa54821332993f5d2ab98c59a) [#531](https://github.com/npm/template-oss/pull/531) uses ci-friendly startsWith instead of fromJSON (#531) (@owlstronaut) + ## [4.26.0](https://github.com/npm/template-oss/compare/v4.25.1...v4.26.0) (2025-10-16) ### Features * [`f3f2f25`](https://github.com/npm/template-oss/commit/f3f2f25f51f2b01565fd1724d40873808f6ad0ca) [#529](https://github.com/npm/template-oss/pull/529) adds testRunner config to specify using node:test (@owlstronaut) diff --git a/lib/content/_step-test-yml.hbs b/lib/content/_step-test-yml.hbs index d860fbf3..a767fb9a 100644 --- a/lib/content/_step-test-yml.hbs +++ b/lib/content/_step-test-yml.hbs @@ -4,10 +4,10 @@ {{/unless}} {{#if isNodeTest}} - name: Test (with coverage on Node >= 24) - if: $\{{ fromJSON(matrix.node-version) >= 24 }} + if: $\{{ startsWith(matrix.node-version, '24') }} run: {{ rootNpmPath }} run test:cover --ignore-scripts {{~#if jobRunFlags}} {{ jobRunFlags }}{{/if}} - name: Test (without coverage on Node < 24) - if: $\{{ fromJSON(matrix.node-version) < 24 }} + if: $\{{ !startsWith(matrix.node-version, '24') }} run: {{ rootNpmPath }} test --ignore-scripts {{~#if jobRunFlags}} {{ jobRunFlags }}{{/if}} {{else}} - name: Test diff --git a/lib/content/package-json.hbs b/lib/content/package-json.hbs index 98bc7b8e..73f288b4 100644 --- a/lib/content/package-json.hbs +++ b/lib/content/package-json.hbs @@ -19,7 +19,7 @@ "template-oss-apply": "template-oss-apply --force", {{#if isNodeTest}} "snap": "node --test --test-update-snapshots", - "test": "node --test --test-timeout=3000", + "test": "node --test", "test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100", {{else}} "snap": "{{#if typescript}}{{#if tap16}}c8 {{/if}}{{/if}}tap", diff --git a/package.json b/package.json index 413a3aab..2b256e35 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/template-oss", - "version": "4.26.0", + "version": "4.26.1", "description": "templated files used in npm CLI team oss projects", "main": "lib/content/index.js", "bin": { diff --git a/test/apply/node-test-ci.js b/test/apply/node-test-ci.js index 6a1d6282..6963fe66 100644 --- a/test/apply/node-test-ci.js +++ b/test/apply/node-test-ci.js @@ -21,8 +21,8 @@ t.test('CI workflow with node:test does not include tap matcher', async t => { // Verify conditional test steps for coverage t.match(ciWorkflow, /Test \(with coverage on Node >= 24\)/, 'should have test with coverage step for Node >= 24') t.match(ciWorkflow, /Test \(without coverage on Node < 24\)/, 'should have test without coverage step for Node < 24') - t.match(ciWorkflow, 'fromJSON(matrix.node-version) >= 24', 'should check if Node version >= 24') - t.match(ciWorkflow, 'fromJSON(matrix.node-version) < 24', 'should check if Node version < 24') + t.match(ciWorkflow, "startsWith(matrix.node-version, '24')", 'should check if Node version starts with 24') + t.match(ciWorkflow, "!startsWith(matrix.node-version, '24')", 'should check if Node version does not start with 24') t.match(ciWorkflow, /test:cover/, 'should use test:cover script for Node >= 24') }) diff --git a/test/apply/node-test.js b/test/apply/node-test.js index 42bd92f5..3cef036a 100644 --- a/test/apply/node-test.js +++ b/test/apply/node-test.js @@ -15,7 +15,7 @@ t.test('node:test runner', async t => { const pkg = await s.readJson('package.json') // Verify test scripts are for node:test - t.equal(pkg.scripts.test, 'node --test --test-timeout=3000') + t.equal(pkg.scripts.test, 'node --test') t.equal( pkg.scripts['test:cover'], 'node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100',