Skip to content

Commit

Permalink
Do not remove titles or significant whitespace from logs in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Apr 11, 2024
1 parent a170e34 commit 7b37a94
Show file tree
Hide file tree
Showing 15 changed files with 246 additions and 257 deletions.
2 changes: 1 addition & 1 deletion lib/cli-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = async (process, validateEngines) => {
exitHandler.setNpm(npm)

// only log node and npm paths in argv initially since argv can contain sensitive info. a cleaned version will be logged later
const log = require('./utils/log-shim.js')
const log = require('proc-log')
log.verbose('cli', process.argv.slice(0, 2).join(' '))
log.info('using', 'npm@%s', npm.version)
log.info('using', 'node@%s', process.version)
Expand Down
44 changes: 22 additions & 22 deletions tap-snapshots/test/lib/commands/dist-tag.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`test/lib/commands/dist-tag.js TAP add new tag > should return success m
`

exports[`test/lib/commands/dist-tag.js TAP add using valid semver range as name > should return success msg 1`] = `
add 1.0.0 to @scoped/[email protected]
dist-tag add 1.0.0 to @scoped/[email protected]
`

exports[`test/lib/commands/dist-tag.js TAP ls in current package > should list available tags for current package 1`] = `
Expand All @@ -20,22 +20,22 @@ latest: 1.0.0
`

exports[`test/lib/commands/dist-tag.js TAP ls on missing package > should log no dist-tag found msg 1`] = `
ls Couldn't get dist-tag data for Result {
ls type: 'range',
ls registry: true,
ls where: undefined,
ls raw: 'foo',
ls name: 'foo',
ls escapedName: 'foo',
ls scope: undefined,
ls rawSpec: '*',
ls saveSpec: null,
ls fetchSpec: '*',
ls gitRange: undefined,
ls gitCommittish: undefined,
ls gitSubdir: undefined,
ls hosted: undefined
ls }
dist-tag ls Couldn't get dist-tag data for Result {
dist-tag ls type: 'range',
dist-tag ls registry: true,
dist-tag ls where: undefined,
dist-tag ls raw: 'foo',
dist-tag ls name: 'foo',
dist-tag ls escapedName: 'foo',
dist-tag ls scope: undefined,
dist-tag ls rawSpec: '*',
dist-tag ls saveSpec: null,
dist-tag ls fetchSpec: '*',
dist-tag ls gitRange: undefined,
dist-tag ls gitCommittish: undefined,
dist-tag ls gitSubdir: undefined,
dist-tag ls hosted: undefined
dist-tag ls }
`

exports[`test/lib/commands/dist-tag.js TAP ls on named package > should list tags for the specified package 1`] = `
Expand All @@ -57,21 +57,21 @@ latest: 2.0.0
`

exports[`test/lib/commands/dist-tag.js TAP remove existing tag > should log remove info 1`] = `
del c from @scoped/another
dist-tag del c from @scoped/another
`

exports[`test/lib/commands/dist-tag.js TAP remove existing tag > should return success msg 1`] = `
-c: @scoped/[email protected]
`

exports[`test/lib/commands/dist-tag.js TAP remove non-existing tag > should log error msg 1`] = `
del nonexistent from @scoped/another
del nonexistent is not a dist-tag on @scoped/another
dist-tag del nonexistent from @scoped/another
dist-tag del nonexistent is not a dist-tag on @scoped/another
`

exports[`test/lib/commands/dist-tag.js TAP set existing version > should log warn msg 1`] = `
add b to @scoped/[email protected]
add b is already set to version 0.6.0
dist-tag add b to @scoped/[email protected]
dist-tag add b is already set to version 0.6.0
`

exports[`test/lib/commands/dist-tag.js TAP workspaces no args > printed the expected output 1`] = `
Expand Down
Loading

0 comments on commit 7b37a94

Please sign in to comment.