diff options
author | Rebecca Turner <me@re-becca.org> | 2017-05-10 22:47:57 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-05-26 04:55:11 +0300 |
commit | fe469a7d0be99cbc47c15c269a1c5342f37c0ef0 (patch) | |
tree | d9f05ef4b4d8ee221e9f7bb009ba8226aa57241b /test | |
parent | ef026e953621f1bade0347f71ce42d323c19ea09 (diff) |
test: tagged-version-matching
Diffstat (limited to 'test')
-rw-r--r-- | test/tap/tagged-version-matching.js (renamed from test/need-npm5-update/tagged-version-matching.js) | 65 |
1 files changed, 38 insertions, 27 deletions
diff --git a/test/need-npm5-update/tagged-version-matching.js b/test/tap/tagged-version-matching.js index f7d51d90b..f5847c265 100644 --- a/test/need-npm5-update/tagged-version-matching.js +++ b/test/tap/tagged-version-matching.js @@ -4,6 +4,7 @@ var test = require('tap').test var Tacks = require('tacks') var File = Tacks.File var Dir = Tacks.Dir +var Symlink = Tacks.Symlink var extend = Object.assign || require('util')._extend var common = require('../common-tap.js') @@ -29,27 +30,18 @@ var fixture = new Tacks(Dir({ global: Dir(), tmp: Dir(), testdir: Dir({ + example: Dir({ + 'package.json': File({ + dependencies: { + tagdep: 'latest', + gitdep: 'npm/example-gitdep' + }, + name: 'example', + version: '1.0.0' + }) + }), node_modules: Dir({ - example: Dir({ - 'package.json': File({ - _from: 'example', - _id: 'example@1.0.0', - _requested: { - raw: 'example@file:example', - scope: null, - escapedName: 'example', - name: 'example', - rawSpec: 'file:example', - type: 'directory' - }, - dependencies: { - tagdep: 'latest', - gitdep: 'npm/example-gitdep' - }, - name: 'example', - version: '1.0.0' - }) - }), + example: Symlink('../example'), gitdep: Dir({ 'package.json': File({ _from: 'npm/example-gitdep', @@ -145,13 +137,32 @@ test('tagged-version-matching', function (t) { t.is(code, 0, 'command ran ok') if (stderr.trim()) t.comment(stderr.trim()) var result = JSON.parse(stdout.trim()) - var problems = result.problems || [] - // Original PR: https://github.com/npm/npm/pull/13941 - // Original issue: https://github.com/npm/npm/issues/13496 - // Original issue: https://github.com/npm/npm/issues/11736 - t.is(problems.length, 0, 'no problems') - t.ok(!problems.some(function (err) { return /missing: tagdep/.test(err) }), 'tagged dependency matched ok') - t.ok(!problems.some(function (err) { return /missing: gitdep/.test(err) }), 'git dependency matched ok') + var expected = { + name: 'tagged-version-matching', + version: '1.0.0', + dependencies: { + example: { + version: '1.0.0', + dependencies: { + gitdep: { + version: '1.0.0', + from: 'npm/example-gitdep' + }, + tagdep: { + version: '1.0.0', + from: 'tagdep@latest' + } + } + }, + gitdep: { + version: '1.0.0', + from: 'npm/example-gitdep' + } + } + } + + t.like(result, expected, 'ls looks ok') + t.is((result.problems || []).length, 0, 'no problems') t.done() }) }) |