Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKat Marchán <kzm@sykosomatic.org>2017-05-17 05:45:01 +0300
committerRebecca Turner <me@re-becca.org>2017-05-26 04:55:24 +0300
commit98851f0dd0f3ce0fedbc4ab50ab8db2f38b43fc9 (patch)
treed21188966dd0ea5c0490bf041dc26bc6b2651337 /test
parent2690121f173984448f9a574ccb51ec70b01ca145 (diff)
shrinkwrap: update createdWith field
Diffstat (limited to 'test')
-rw-r--r--test/tap/shrinkwrap-empty-deps.js12
-rw-r--r--test/tap/shrinkwrap-extra-metadata.js9
2 files changed, 11 insertions, 10 deletions
diff --git a/test/tap/shrinkwrap-empty-deps.js b/test/tap/shrinkwrap-empty-deps.js
index f2761a19b..734bd1738 100644
--- a/test/tap/shrinkwrap-empty-deps.js
+++ b/test/tap/shrinkwrap-empty-deps.js
@@ -48,17 +48,11 @@ test('returns a list of removed items', function (t) {
t.ifError(err, 'shrinkwrap ran without issue')
t.notOk(code, 'shrinkwrap ran without raising error code')
- fs.readFile(path.resolve(pkg, 'npm-shrinkwrap.json'), function (err, desired) {
+ fs.readFile(path.resolve(pkg, 'npm-shrinkwrap.json'), function (err, found) {
t.ifError(err, 'read npm-shrinkwrap.json without issue')
t.same(
- {
- 'name': 'shrinkwrap-empty-deps',
- 'version': '0.0.0',
- 'createdWith': `npm@${npm.version}`,
- 'lockfileVersion': npm.lockfileVersion,
- 'packageIntegrity': pkgSri.hash(json)
- },
- JSON.parse(desired),
+ JSON.parse(found).dependencies,
+ undefined,
'shrinkwrap handled empty deps without exploding'
)
diff --git a/test/tap/shrinkwrap-extra-metadata.js b/test/tap/shrinkwrap-extra-metadata.js
index 5c40faf5c..fa3afcc09 100644
--- a/test/tap/shrinkwrap-extra-metadata.js
+++ b/test/tap/shrinkwrap-extra-metadata.js
@@ -52,7 +52,14 @@ test('adds additional metadata fields from the pkglock spec', function (t) {
{
'name': 'shrinkwrap-extra-metadata',
'version': '0.0.0',
- 'createdWith': `npm@${npm.version}`,
+ 'createdWith': {
+ installer: `${npm.name}@${npm.version}`,
+ runtime: `${process.release.name}@${
+ process.version.slice(process.version[0] === 'v' ? 1 : 0)
+ }`,
+ platform: process.platform,
+ arch: process.arch
+ },
'lockfileVersion': npm.lockfileVersion,
'packageIntegrity': pkgSri.hash(json)
},