diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2017-05-17 05:45:01 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-05-26 04:55:24 +0300 |
commit | 98851f0dd0f3ce0fedbc4ab50ab8db2f38b43fc9 (patch) | |
tree | d21188966dd0ea5c0490bf041dc26bc6b2651337 /test | |
parent | 2690121f173984448f9a574ccb51ec70b01ca145 (diff) |
shrinkwrap: update createdWith field
Diffstat (limited to 'test')
-rw-r--r-- | test/tap/shrinkwrap-empty-deps.js | 12 | ||||
-rw-r--r-- | test/tap/shrinkwrap-extra-metadata.js | 9 |
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) }, |