Skip to content
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
4 changes: 2 additions & 2 deletions lib/content/_step-test-yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/content/package-json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions test/apply/node-test-ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})

Expand Down
2 changes: 1 addition & 1 deletion test/apply/node-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down