mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-02 20:05:14 -04:00
Add test for npm shrinkwrap compatibility
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
"eslint-config-standard": "4.4.0",
|
||||
"eslint-plugin-standard": "1.3.1",
|
||||
"nixt": "0.5.0",
|
||||
"npm": "3.6.0",
|
||||
"sepia": "2.0.1",
|
||||
"tap-spec": "4.1.1",
|
||||
"tape": "4.4.0",
|
||||
|
||||
@@ -147,3 +147,19 @@ test('tarballs (is-array-1.0.1.tgz)', function (t) {
|
||||
}, t.end)
|
||||
})
|
||||
|
||||
test('shrinkwrap compatibility', function (t) {
|
||||
prepare()
|
||||
fs.writeFileSync('package.json',
|
||||
JSON.stringify({ dependencies: { rimraf: '*' } }),
|
||||
'utf-8')
|
||||
|
||||
install({ input: ['rimraf@2.5.1'], flags: { quiet: true } })
|
||||
.then(function () {
|
||||
var npm = JSON.stringify(require.resolve('npm/bin/npm-cli.js'))
|
||||
require('child_process').execSync('node ' + npm + ' shrinkwrap')
|
||||
var wrap = JSON.parse(fs.readFileSync('npm-shrinkwrap.json', 'utf-8'))
|
||||
t.ok(wrap.dependencies.rimraf.version === '2.5.1',
|
||||
'npm shrinkwrap is successful')
|
||||
t.end()
|
||||
}, t.end)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user