Skip to content

Commit 667b79a

Browse files
committed
test: do not depend on npm.version in usage test
1 parent 0152dfc commit 667b79a

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ or on the command line via: npm <command> --key=value
3737
More configuration info: npm help config
3838
Configuration fields: npm help 7 config
3939
40-
npm@7.99.9999 {BASEDIR}
40+
npm@{VERSION} {BASEDIR}
4141
4242
`
4343

@@ -73,7 +73,7 @@ or on the command line via: npm <command> --key=value
7373
More configuration info: npm help config
7474
Configuration fields: npm help 7 config
7575
76-
npm@7.99.9999 {BASEDIR}
76+
npm@{VERSION} {BASEDIR}
7777
7878
`
7979

@@ -116,7 +116,7 @@ or on the command line via: npm <command> --key=value
116116
More configuration info: npm help config
117117
Configuration fields: npm help 7 config
118118
119-
npm@7.99.9999 {BASEDIR}
119+
npm@{VERSION} {BASEDIR}
120120
121121
`
122122

@@ -152,7 +152,7 @@ or on the command line via: npm <command> --key=value
152152
More configuration info: npm help config
153153
Configuration fields: npm help 7 config
154154
155-
npm@7.99.9999 {BASEDIR}
155+
npm@{VERSION} {BASEDIR}
156156
157157
`
158158

@@ -188,7 +188,7 @@ or on the command line via: npm <command> --key=value
188188
More configuration info: npm help config
189189
Configuration fields: npm help 7 config
190190
191-
npm@7.99.9999 {BASEDIR}
191+
npm@{VERSION} {BASEDIR}
192192
193193
`
194194

@@ -470,7 +470,7 @@ All commands:
470470
version npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
471471
(run in package dir)
472472
473-
'npm -v' or 'npm --version' to print npm version (7.5.0)
473+
'npm -v' or 'npm --version' to print npm version ({VERSION})
474474
'npm view <pkg> version' to view a package's published version
475475
'npm ls' to inspect current package/dependency versions
476476
@@ -490,6 +490,6 @@ or on the command line via: npm <command> --key=value
490490
More configuration info: npm help config
491491
Configuration fields: npm help 7 config
492492
493-
npm@7.99.9999 {BASEDIR}
493+
npm@{VERSION} {BASEDIR}
494494
495495
`

test/lib/utils/npm-usage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const npm = {
2020
},
2121
},
2222
log: {},
23-
version: '7.99.9999',
23+
version: '{VERSION}',
2424
}
2525

2626
const OUTPUT = []
@@ -29,6 +29,7 @@ const output = (...msg) => OUTPUT.push(msg)
2929
const { dirname } = require('path')
3030
const basedir = dirname(dirname(dirname(__dirname)))
3131
t.cleanSnapshot = str => str.split(basedir).join('{BASEDIR}')
32+
.split(require('../../../package.json').version).join('{VERSION}')
3233

3334
const requireInject = require('require-inject')
3435
const usage = requireInject('../../../lib/utils/npm-usage.js', {

0 commit comments

Comments
 (0)