diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2016-12-11 10:47:28 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2016-12-13 03:24:08 +0300 |
commit | c9b279aca0fcb8d0e483e534c7f9a7250e2a9392 (patch) | |
tree | de47558619466b6f62a9067e9664172f9f5cf6b8 /test | |
parent | 190a658c4222f6aa904cbc640fc394a5c875e4db (diff) |
add-named: allow splat tag to be configurable
Credit: @zkat
PR-URL: https://github.com/npm/npm/pull/15196
Reviewed-By: @iarna
Diffstat (limited to 'test')
-rw-r--r-- | test/tap/splat-with-only-prerelease-to-latest.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/tap/splat-with-only-prerelease-to-latest.js b/test/tap/splat-with-only-prerelease-to-latest.js index 2598d5578..73eeee81a 100644 --- a/test/tap/splat-with-only-prerelease-to-latest.js +++ b/test/tap/splat-with-only-prerelease-to-latest.js @@ -7,7 +7,8 @@ var moduleName = 'xyzzy-wibble' var testModule = { name: moduleName, 'dist-tags': { - latest: '1.3.0-a' + latest: '1.3.0-a', + other: '1.2.0-a' }, versions: { '1.0.0-a': { @@ -69,12 +70,19 @@ test('setup', function (t) { }) test('splat', function (t) { - t.plan(4) + t.plan(8) var addNamed = require('../../lib/cache/add-named.js') addNamed('xyzzy-wibble', '*', testModule, function (err, pkg) { t.error(err, 'Succesfully resolved a splat package') t.is(pkg.name, moduleName) t.is(pkg.version, testModule['dist-tags'].latest) t.is(lastFetched, 'https://registry.npmjs.org/aproba/-/xyzzy-wibble-1.3.0-a.tgz') + npm.config.set('tag', 'other') + addNamed('xyzzy-wibble', '*', testModule, function (err, pkg) { + t.error(err, 'Succesfully resolved a splat package') + t.is(pkg.name, moduleName) + t.is(pkg.version, testModule['dist-tags'].other) + t.is(lastFetched, 'https://registry.npmjs.org/aproba/-/xyzzy-wibble-1.2.0-a.tgz') + }) }) }) |