Skip to content

Commit

Permalink
deps: tap@21.0.1 (#498)
Browse files Browse the repository at this point in the history
Resurfaces an old PR that updated tap 16 -> 19 (still not sure what's
needed from that until i see the diff.
Had to do some googling to find why `/* istanbul ignore next */` doesn't
work anymore.

tapjs/tapjs#1027

got some node 22
failures - ENOENT: no such file or directory, open
'/home/runner/work/template-oss/template-oss/.tap/fixtures/test-apply-esm.js-basic/file.js'

doesn't work on 20.5.0 because of
tapjs/tapjs#1028
  • Loading branch information
reggi authored Jan 30, 2025
1 parent 402d480 commit 83c0c7d
Show file tree
Hide file tree
Showing 25 changed files with 98 additions and 67 deletions.
12 changes: 12 additions & 0 deletions lib/content/package-json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,24 @@
},
"templateVersion": {{{ del }}},
"standard": {{{ del }}},
"nyc": {{#if tap18}}{
"exclude": {{{ json workspaceGlobs }}}
}{{else}}{{{ del }}}{{/if}},
"tap": {
{{#if tap18}}
{{#if workspaceGlobs}}
"exclude": {{{ json workspaceGlobs }}},
{{/if}}
"test-ignore": {{{ del }}},
{{else}}
"exclude": {{{ del }}},
{{#if workspacePaths}}
"exclude": {{#if tap18}}[
"{{ join workspaceGlobs "," }}"
]{{else }}{{{ del }}}{{/if}},
"test-ignore": {{#if tap18}}{{{ del }}}{{else}}"^({{ join workspacePaths "|" }})/"{{/if}},
{{/if}}
{{/if}}
{{#if typescript}}
{{#if tap16}}
"coverage": false,
Expand All @@ -57,6 +68,7 @@
],
{{/if}}
{{/if}}
"show-full-coverage": {{#if tap18}}true{{else}}{{{ del }}}{{/if}},
"nyc-arg": {{#if tap18}}{{{ del }}}{{else}}[
{{#each workspaceGlobs}}
"--exclude",
Expand Down
4 changes: 3 additions & 1 deletion lib/release/node-workspace-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const { TagName } = require('release-please/build/src/util/tag-name.js')
const { ROOT_PROJECT_PATH } = require('release-please/build/src/manifest.js')
const { DEPS, link, wrapSpecs, list } = require('./util.js')

/* istanbul ignore next: TODO fix flaky tests and enable coverage */
/* TODO fix flaky tests and enable coverage */
/* c8 ignore start */
module.exports = class extends ManifestPlugin {
static WORKSPACE_MESSAGE = (name, version) => `${DEPS}(workspace): ${name}@${version}`

Expand Down Expand Up @@ -95,3 +96,4 @@ module.exports = class extends ManifestPlugin {
}
}
}
/* c8 ignore end */
3 changes: 2 additions & 1 deletion lib/release/release-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,14 @@ class ReleaseManager {
// If the url fails with anything but a 404 we want the process to blow
// up because that means something is very wrong. This is a rare edge
// case that isn't worth testing.
/* istanbul ignore else */

if (r.statusCode === 200) {
this.#info('Found release process from wiki')
return r.body.text()
} else if (r.statusCode === 404) {
this.#info('No release process found in wiki, falling back to default process')
return this.#getReleaseSteps()
/* c8 ignore next 3 */
} else {
throw new Error(`Release process fetch failed with status: ${r.statusCode}`)
}
Expand Down
4 changes: 3 additions & 1 deletion lib/release/release-please.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const NodeWorkspaceFormat = require('./node-workspace-format.js')
const { getPublishTag, noop } = require('./util.js')
const { SemverVersioningStrategy } = require('./semver-versioning-strategy.js')

/* istanbul ignore next: TODO fix flaky tests and enable coverage */
/* TODO fix flaky tests and enable coverage */
/* c8 ignore start */
class ReleasePlease {
#token
#owner
Expand Down Expand Up @@ -163,5 +164,6 @@ class ReleasePlease {
return releases.length ? releases : null
}
}
/* c8 ignore end */

module.exports = ReleasePlease
3 changes: 2 additions & 1 deletion lib/release/semver-versioning-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ class SemverVersioningStrategy {
const releaseType = parseCommits(commits)
const addPreIfNeeded = prerelease ? `pre${releaseType}` : releaseType
const version = inc(currentVersion.toString(), addPreIfNeeded, tag)
/* istanbul ignore next */
/* c8 ignore start */
if (!version) {
throw new Error('Could not bump version')
}
/* c8 ignore stop */
return Version.parse(version)
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/util/import-or-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const importOrRequire = async path => {
try {
content = require(path)
// this is for node 22+
// istanbul ignore next
/* c8 ignore start */
if (content.__esModule) {
return content.default
}
/* c8 ignore end */
} catch {
// istanbul ignore next
try {
// this is for node under 20
const results = await import(pathToFileURL(path))
Expand Down
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,17 @@
"eslint-config-prettier": "^9.1.0",
"nock": "^13.3.8",
"prettier": "^3.2.5",
"tap": "^16.0.0"
"tap": "^21.0.1"
},
"tap": {
"timeout": 600,
"nyc-arg": [
"--exclude",
"workspace/test-workspace/**",
"--exclude",
"tap-snapshots/**"
],
"test-ignore": "^(workspace/test-workspace)/",
"node-arg": [
"--no-experimental-fetch"
]
],
"exclude": [
"workspace/test-workspace/**"
],
"show-full-coverage": true
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
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 @@ -1426,7 +1426,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 @@ -1444,7 +1444,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 @@ -3272,7 +3272,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 @@ -4636,7 +4636,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
Loading

0 comments on commit 83c0c7d

Please sign in to comment.