Skip to content

Commit

Permalink
adds support for tap 19, updates snaps to use new delimeter, rm nyc-a…
Browse files Browse the repository at this point in the history
…rgs for over 17, custom top-level nyc excludes
  • Loading branch information
reggi committed May 29, 2024
1 parent b07d17a commit a3efc5a
Show file tree
Hide file tree
Showing 19 changed files with 79 additions and 58 deletions.
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const getFullConfig = async ({
cjsExt: esm ? 'cjs' : 'js',
deleteJsExt: esm ? 'js' : 'cjs',
// tap
tap18: semver.coerce(pkg.pkgJson?.devDependencies?.tap)?.major === 18,
tapOver17: semver.coerce(pkg.pkgJson?.devDependencies?.tap)?.major > 17,
tap16: semver.coerce(pkg.pkgJson?.devDependencies?.tap)?.major === 16,
// booleans to control application of updates
isForce,
Expand Down
13 changes: 12 additions & 1 deletion lib/content/package-json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,20 @@
},
"templateVersion": {{{ del }}},
"standard": {{{ del }}},
"nyc": {{#if tapOver17}}{
"exclude": {{{ json workspaceGlobs }}}
}{{else}}{{{ del }}}{{/if}},
"tap": {
{{#if tapOver17}}
{{#if workspaceGlobs}}
"exclude": {{{ json workspaceGlobs }}},
{{/if}}
"test-ignore": {{{ del }}},
{{else}}
{{#if workspacePaths}}
"test-ignore": "^({{ join workspacePaths "|" }})/",
{{/if}}
{{/if}}
{{#if typescript}}
{{#if tap16}}
"coverage": false,
Expand All @@ -54,7 +64,8 @@
],
{{/if}}
{{/if}}
"nyc-arg": {{#if tap18}}{{{ del }}}{{else}}[
"show-full-coverage": {{#if tapOver17}}true{{else}}{{{ del }}}{{/if}},
"nyc-arg": {{#if tapOver17}}{{{ del }}}{{else}}[
{{#each workspaceGlobs}}
"--exclude",
"{{ . }}",
Expand Down
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,16 @@
"eslint-config-prettier": "^9.1.0",
"nock": "^13.3.8",
"prettier": "^3.2.5",
"tap": "^16.0.0"
"tap": "^19.0.2"
},
"tap": {
"timeout": 600,
"nyc-arg": [
"--exclude",
"workspace/test-workspace/**",
"--exclude",
"tap-snapshots/**"
],
"test-ignore": "^(workspace/test-workspace)/",
"node-arg": [
"--no-experimental-fetch"
],
"show-full-coverage": true,
"exclude": [
"workspace/test-workspace/**"
]
},
"templateOSS": {
Expand All @@ -98,5 +95,10 @@
},
"workspaces": [
"workspace/test-workspace"
]
],
"nyc": {
"exclude": [
"workspace/test-workspace/**"
]
}
}
18 changes: 9 additions & 9 deletions tap-snapshots/test/apply/files-snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/apply/files-snapshots.js TAP private workspace > expect resolving Promise 1`] = `
exports[`test/apply/files-snapshots.js > TAP > private workspace > promise must resolve to match snapshot 1`] = `
.commitlintrc.js
.eslintrc.js
.github/actions/create-check/action.yml
Expand Down Expand Up @@ -42,7 +42,7 @@ workspaces/b/.gitignore
workspaces/b/package.json
`

exports[`test/apply/files-snapshots.js TAP turn off add/rm types > expect resolving Promise 1`] = `
exports[`test/apply/files-snapshots.js > TAP > turn off add/rm types > promise must resolve to match snapshot 1`] = `
.commitlintrc.js
.github/actions/create-check/action.yml
.github/actions/install-latest-npm/action.yml
Expand All @@ -65,7 +65,7 @@ package.json
release-please-config.json
`

exports[`test/apply/files-snapshots.js TAP turn off module > expect resolving Promise 1`] = `
exports[`test/apply/files-snapshots.js > TAP > turn off module > promise must resolve to match snapshot 1`] = `
.commitlintrc.js
.github/actions/create-check/action.yml
.github/actions/install-latest-npm/action.yml
Expand All @@ -88,7 +88,7 @@ package.json
release-please-config.json
`

exports[`test/apply/files-snapshots.js TAP turn off repo > expect resolving Promise 1`] = `
exports[`test/apply/files-snapshots.js > TAP > turn off repo > promise must resolve to match snapshot 1`] = `
.eslintrc.js
.gitignore
.npmrc
Expand All @@ -98,11 +98,11 @@ package.json
SECURITY.md
`

exports[`test/apply/files-snapshots.js TAP turn off root > expect resolving Promise 1`] = `
exports[`test/apply/files-snapshots.js > TAP > turn off root > promise must resolve to match snapshot 1`] = `
package.json
`

exports[`test/apply/files-snapshots.js TAP turn off specific files > expect resolving Promise 1`] = `
exports[`test/apply/files-snapshots.js > TAP > turn off specific files > promise must resolve to match snapshot 1`] = `
.eslintrc.yml
.github/actions/create-check/action.yml
.github/actions/install-latest-npm/action.yml
Expand Down Expand Up @@ -131,7 +131,7 @@ release-please-config.json
SECURITY.md
`

exports[`test/apply/files-snapshots.js TAP workspaces > expect resolving Promise 1`] = `
exports[`test/apply/files-snapshots.js > TAP > workspaces > promise must resolve to match snapshot 1`] = `
.github/actions/create-check/action.yml
.github/actions/install-latest-npm/action.yml
.github/dependabot.yml
Expand All @@ -158,7 +158,7 @@ workspaces/d/.gitignore
workspaces/d/package.json
`

exports[`test/apply/files-snapshots.js TAP workspaces only (like npm/cli) > expect resolving Promise 1`] = `
exports[`test/apply/files-snapshots.js > TAP > workspaces only (like npm/cli) > promise must resolve to match snapshot 1`] = `
.github/actions/create-check/action.yml
.github/actions/install-latest-npm/action.yml
.github/dependabot.yml
Expand All @@ -182,7 +182,7 @@ workspaces/b/.gitignore
workspaces/b/package.json
`

exports[`test/apply/files-snapshots.js TAP workspaces with relative content path > expect resolving Promise 1`] = `
exports[`test/apply/files-snapshots.js > TAP > workspaces with relative content path > promise must resolve to match snapshot 1`] = `
content_dir/index.js
content_dir2/index.js
package.json
Expand Down
10 changes: 5 additions & 5 deletions tap-snapshots/test/apply/source-snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/apply/source-snapshots.js TAP root only > expect resolving Promise 1`] = `
exports[`test/apply/source-snapshots.js > TAP > root only > promise must resolve to match snapshot 1`] = `
.commitlintrc.js
========================================
/* This file is automatically added by @npmcli/template-oss. Do not edit. */
Expand Down Expand Up @@ -1425,7 +1425,7 @@ If the vulnerability you have found is [in scope for the GitHub Bug Bounty Progr
Thanks for helping make GitHub safe for everyone.
`

exports[`test/apply/source-snapshots.js TAP with content path > expect resolving Promise 1`] = `
exports[`test/apply/source-snapshots.js > TAP > with content path > promise must resolve to match snapshot 1`] = `
content_dir/index.js
========================================
module.exports={}
Expand All @@ -1443,7 +1443,7 @@ package.json
}
`

exports[`test/apply/source-snapshots.js TAP with workspaces > expect resolving Promise 1`] = `
exports[`test/apply/source-snapshots.js > TAP > with workspaces > promise must resolve to match snapshot 1`] = `
.commitlintrc.js
========================================
/* This file is automatically added by @npmcli/template-oss. Do not edit. */
Expand Down Expand Up @@ -3270,7 +3270,7 @@ workspaces/b/package.json
}
`

exports[`test/apply/source-snapshots.js TAP workspaces only > expect resolving Promise 1`] = `
exports[`test/apply/source-snapshots.js > TAP > workspaces only > promise must resolve to match snapshot 1`] = `
.github/actions/create-check/action.yml
========================================
# This file is automatically added by @npmcli/template-oss. Do not edit.
Expand Down Expand Up @@ -4634,7 +4634,7 @@ workspaces/b/package.json
}
`

exports[`test/apply/source-snapshots.js TAP workspaces with nested content path > expect resolving Promise 1`] = `
exports[`test/apply/source-snapshots.js > TAP > workspaces with nested content path > promise must resolve to match snapshot 1`] = `
content_dir/index.js
========================================
module.exports={}
Expand Down
2 changes: 1 addition & 1 deletion tap-snapshots/test/bin/check.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/bin/check.js TAP problems > must match snapshot 1`] = `
exports[`test/bin/check.js > TAP > problems > must match snapshot 1`] = `
Some problems were detected:
Expand Down
16 changes: 8 additions & 8 deletions tap-snapshots/test/check/diff-snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/check/diff-snapshots.js TAP different headers > expect resolving Promise 1`] = `
exports[`test/check/diff-snapshots.js > TAP > different headers > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand All @@ -21,7 +21,7 @@ To correct it: npx template-oss-apply --force
-------------------------------------------------------------------
`

exports[`test/check/diff-snapshots.js TAP json delete > expect resolving Promise 1`] = `
exports[`test/check/diff-snapshots.js > TAP > json delete > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand All @@ -39,7 +39,7 @@ To correct it: npx template-oss-apply --force
-------------------------------------------------------------------
`

exports[`test/check/diff-snapshots.js TAP json merge > initial check 1`] = `
exports[`test/check/diff-snapshots.js > TAP > json merge > initial check 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand All @@ -56,7 +56,7 @@ To correct it: npx template-oss-apply --force
-------------------------------------------------------------------
`

exports[`test/check/diff-snapshots.js TAP json overwrite > expect resolving Promise 1`] = `
exports[`test/check/diff-snapshots.js > TAP > json overwrite > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand All @@ -73,7 +73,7 @@ To correct it: npx template-oss-apply --force
-------------------------------------------------------------------
`

exports[`test/check/diff-snapshots.js TAP unknown file type > expect resolving Promise 1`] = `
exports[`test/check/diff-snapshots.js > TAP > unknown file type > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand All @@ -87,7 +87,7 @@ To correct it: npx template-oss-apply --force
-------------------------------------------------------------------
`

exports[`test/check/diff-snapshots.js TAP update and remove errors > expect resolving Promise 1`] = `
exports[`test/check/diff-snapshots.js > TAP > update and remove errors > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand All @@ -97,7 +97,7 @@ The repo file audit.yml needs to be updated:
.github/workflows/audit.yml
========================================
[@npmcli/template-oss ERROR] There was an erroring getting the target file
[@npmcli/template-oss ERROR] Error: {{ROOT}}/test/check/tap-testdir-diff-snapshots-update-and-remove-errors/.github/workflows/audit.yml
[@npmcli/template-oss ERROR] Error: {{ROOT}}/.tap/fixtures/test-check-diff-snapshots.js-update-and-remove-errors/.github/workflows/audit.yml
YAMLParseError: Implicit keys need to be on a single line at line 42, column 1:
Expand Down Expand Up @@ -222,7 +222,7 @@ To correct it: npx template-oss-apply --force
-------------------------------------------------------------------
`

exports[`test/check/diff-snapshots.js TAP will diff json > expect resolving Promise 1`] = `
exports[`test/check/diff-snapshots.js > TAP > will diff json > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions tap-snapshots/test/check/snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/check/snapshots.js TAP changelog > expect resolving Promise 1`] = `
exports[`test/check/snapshots.js > TAP > changelog > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand All @@ -22,7 +22,7 @@ To correct it: reformat the changelog to have the correct heading
-------------------------------------------------------------------
`

exports[`test/check/snapshots.js TAP check empty dir > expect resolving Promise 1`] = `
exports[`test/check/snapshots.js > TAP > check empty dir > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand Down Expand Up @@ -111,7 +111,7 @@ To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @n
-------------------------------------------------------------------
`

exports[`test/check/snapshots.js TAP gitignore > expect resolving Promise 1`] = `
exports[`test/check/snapshots.js > TAP > gitignore > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand Down Expand Up @@ -156,7 +156,7 @@ To correct it: move files to not match one of the following patterns:
-------------------------------------------------------------------
`

exports[`test/check/snapshots.js TAP gitignore with workspaces workspace > expect resolving Promise 1`] = `
exports[`test/check/snapshots.js > TAP > gitignore with workspaces workspace > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand Down Expand Up @@ -258,7 +258,7 @@ To correct it: move files to not match one of the following patterns:
-------------------------------------------------------------------
`

exports[`test/check/snapshots.js TAP not ok without required > expect resolving Promise 1`] = `
exports[`test/check/snapshots.js > TAP > not ok without required > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand All @@ -274,7 +274,7 @@ To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @n
-------------------------------------------------------------------
`

exports[`test/check/snapshots.js TAP unwanted > expect resolving Promise 1`] = `
exports[`test/check/snapshots.js > TAP > unwanted > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand All @@ -288,7 +288,7 @@ To correct it: npm rm eslint
-------------------------------------------------------------------
`

exports[`test/check/snapshots.js TAP workspaces with empty dir > expect resolving Promise 1`] = `
exports[`test/check/snapshots.js > TAP > workspaces with empty dir > promise must resolve to match snapshot 1`] = `
Some problems were detected:
-------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/release/release-manager.js TAP mock release manager > must match snapshot 1`] = `
exports[`test/release/release-manager.js > TAP > mock release manager > must match snapshot 1`] = `
### Release Checklist for v4.0.5
- [ ] 1. Checkout the release branch and test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/release/release-manager.js TAP npm/cli > must match snapshot 1`] = `
exports[`test/release/release-manager.js > TAP > npm/cli > must match snapshot 1`] = `
### Release Checklist for v10.2.5
- [ ] 1. Checkout the release branch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/release/release-manager.js TAP prerelease > must match snapshot 1`] = `
exports[`test/release/release-manager.js > TAP > prerelease > must match snapshot 1`] = `
### Release Checklist for v10.0.0-pre.0
- [ ] 1. Checkout the release branch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/release/release-manager.js TAP publish and lockfile > must match snapshot 1`] = `
exports[`test/release/release-manager.js > TAP > publish and lockfile > must match snapshot 1`] = `
### Release Checklist for v7.5.4
- [ ] 1. Approve this PR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/release/release-manager.js TAP single release > must match snapshot 1`] = `
exports[`test/release/release-manager.js > TAP > single release > must match snapshot 1`] = `
### Release Checklist for v7.5.4
- [ ] 1. Checkout the release branch and test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/release/release-manager.js TAP workspace names > expect resolving Promise 1`] = `
exports[`test/release/release-manager.js > TAP > workspace names > promise must resolve to match snapshot 1`] = `
### Release Checklist for v10.2.2
- [ ] 1. Checkout the release branch
Expand Down
Loading

0 comments on commit a3efc5a

Please sign in to comment.