Skip to content

Commit

Permalink
chore: fix npm.js snapshots (#6303)
Browse files Browse the repository at this point in the history
strip current npm version out
  • Loading branch information
wraithgar authored Mar 29, 2023
1 parent e252532 commit a57a97b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
20 changes: 10 additions & 10 deletions tap-snapshots/test/lib/npm.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
npm@9.6.2 {NPMROOT}
npm@{VERSION} {NPMROOT}
`

exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 1 > must match snapshot 1`] = `
Expand Down Expand Up @@ -91,7 +91,7 @@ or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
npm@9.6.2 {NPMROOT}
npm@{VERSION} {NPMROOT}
`

exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 10 > must match snapshot 1`] = `
Expand Down Expand Up @@ -143,7 +143,7 @@ or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
npm@9.6.2 {NPMROOT}
npm@{VERSION} {NPMROOT}
`

exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 100 > must match snapshot 1`] = `
Expand Down Expand Up @@ -180,7 +180,7 @@ or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
npm@9.6.2 {NPMROOT}
npm@{VERSION} {NPMROOT}
`

exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 24 > must match snapshot 1`] = `
Expand Down Expand Up @@ -232,7 +232,7 @@ or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
npm@9.6.2 {NPMROOT}
npm@{VERSION} {NPMROOT}
`

exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 40 > must match snapshot 1`] = `
Expand Down Expand Up @@ -284,7 +284,7 @@ or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
npm@9.6.2 {NPMROOT}
npm@{VERSION} {NPMROOT}
`

exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 41 > must match snapshot 1`] = `
Expand Down Expand Up @@ -335,7 +335,7 @@ or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
npm@9.6.2 {NPMROOT}
npm@{VERSION} {NPMROOT}
`

exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 75 > must match snapshot 1`] = `
Expand Down Expand Up @@ -372,7 +372,7 @@ or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
npm@9.6.2 {NPMROOT}
npm@{VERSION} {NPMROOT}
`

exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 76 > must match snapshot 1`] = `
Expand Down Expand Up @@ -409,7 +409,7 @@ or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
npm@9.6.2 {NPMROOT}
npm@{VERSION} {NPMROOT}
`

exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 90 > must match snapshot 1`] = `
Expand Down Expand Up @@ -446,5 +446,5 @@ or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
npm@9.6.2 {NPMROOT}
npm@{VERSION} {NPMROOT}
`
4 changes: 3 additions & 1 deletion test/lib/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,9 @@ t.test('usage', async t => {
config: { viewer: 'man' },
})
t.cleanSnapshot = str =>
str.replace(npm.config.get('userconfig'), '{USERCONFIG}').replace(npm.npmRoot, '{NPMROOT}')
str.replace(npm.config.get('userconfig'), '{USERCONFIG}')
.replace(npm.npmRoot, '{NPMROOT}')
.replace(`npm@${npm.version}`, 'npm@{VERSION}')

const widths = [0, 1, 10, 24, 40, 41, 75, 76, 90, 100]
for (const width of widths) {
Expand Down

0 comments on commit a57a97b

Please sign in to comment.