Skip to content

Commit

Permalink
test: Update fixture lockfile formats
Browse files Browse the repository at this point in the history
PR-URL: npm/npm#17508
Credit: @iarna
Reviewed-By: @zkat
  • Loading branch information
iarna authored and zkat committed Jul 5, 2017
1 parent 07cefb1 commit e8f02f3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
15 changes: 7 additions & 8 deletions test/tap/shrinkwrap-version-match.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ var fs = require('fs')
var path = require('path')
var common = require('../common-tap.js')

// NOTE: This test will only remain relavent until npm@5 when
// npm-shrinkwrap.json will override EVERYTHING in you package.json.
// If you're working on npm@5 and this broke, just remove the test.

var testdir = path.resolve(__dirname, path.basename(__filename, '.js'))
var modAdir = path.resolve(testdir, 'modA')
var modB1dir = path.resolve(testdir, 'modB@1')
Expand All @@ -27,14 +23,17 @@ var fixture = new Tacks(Dir({
}
}),
'npm-shrinkwrap.json': File({
requires: true,
lockfileVersion: 1,
dependencies: {
modA: {
version: '1.0.0',
resolved: 'file://' + modAdir
version: 'file://' + modAdir,
requires: {
modB: 'file://' + modB1dir
}
},
modB: {
version: '1.0.0',
resolved: 'file://' + modB1dir
version: 'file://' + modB1dir
}
}
}),
Expand Down
19 changes: 12 additions & 7 deletions test/tap/tagged-version-matching.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var fixture = new Tacks(Dir({
directUrl: 'https://raw.githubusercontent.com/npm/example-gitdep/da39a3ee5e6b4b0d3255bfef95601890afd80709/package.json'
}
},
_resolved: 'github:npm/example-gitdep#da39a3ee5e6b4b0d3255bfef95601890afd80709',
name: 'gitdep',
version: '1.0.0'
})
Expand All @@ -72,6 +73,7 @@ var fixture = new Tacks(Dir({
'package.json': File({
_from: 'tagdep@latest',
_id: '[email protected]',
_integrity: 'sha1-0EJSKmsdk39848LlrRg/hZQo2B8=',
_requested: {
raw: 'tagdep@https://registry.example.com/tagdep/-/tagdep-1.0.0.tgz',
scope: null,
Expand All @@ -89,20 +91,23 @@ var fixture = new Tacks(Dir({
'npm-shrinkwrap.json': File({
name: 'tagged-version-matching',
version: '1.0.0',
lockfileVersion: 1,
requires: true,
dependencies: {
tagdep: {
version: '1.0.0',
from: 'tagdep@latest',
resolved: 'https://registry.example.com/tagdep/-/tagdep-1.0.0.tgz'
resolved: 'https://registry.example.com/tagdep/-/tagdep-1.0.0.tgz',
integrity: 'sha1-0EJSKmsdk39848LlrRg/hZQo2B8='
},
example: {
version: '1.0.0',
from: 'example'
version: 'file:example',
requires: {
tagdep: '1.0.0',
gitdep: 'github:npm/example-gitdep#da39a3ee5e6b4b0d3255bfef95601890afd80709'
}
},
gitdep: {
version: '1.0.0',
from: 'npm/example-gitdep',
resolved: 'git://github.com/npm/example-gitdep.git#da39a3ee5e6b4b0d3255bfef95601890afd80709'
version: 'github:npm/example-gitdep#da39a3ee5e6b4b0d3255bfef95601890afd80709'
}
}
}),
Expand Down

0 comments on commit e8f02f3

Please sign in to comment.