X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Ftest%2Ftap%2Fsplat-with-only-prerelease-to-latest.js;fp=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Ftest%2Ftap%2Fsplat-with-only-prerelease-to-latest.js;h=b212b86a6bbf11c24feda208663e5efc19a6cb60;hb=2529be6d456deeb07c128603ce4971f1dc29b695;hp=0000000000000000000000000000000000000000;hpb=2636fc31c16c23711cf2b06a4ae8537bba9c1d35;p=simantics%2Fdistrict.git diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/splat-with-only-prerelease-to-latest.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/splat-with-only-prerelease-to-latest.js new file mode 100644 index 00000000..b212b86a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/splat-with-only-prerelease-to-latest.js @@ -0,0 +1,80 @@ +'use strict' +var test = require('tap').test +var npm = require('../../lib/npm') +var stream = require('readable-stream') + +// set up environment +require('../common-tap.js') + +var moduleName = 'xyzzy-wibble' +var testModule = { + name: moduleName, + 'dist-tags': { + latest: '1.3.0-a' + }, + versions: { + '1.0.0-a': { + name: moduleName, + version: '1.0.0-a', + dist: { + shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', + tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.0.0-a.tgz' + } + }, + '1.1.0-a': { + name: moduleName, + version: '1.1.0-a', + dist: { + shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', + tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.1.0-a.tgz' + } + }, + '1.2.0-a': { + name: moduleName, + version: '1.2.0-a', + dist: { + shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', + tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.2.0-a.tgz' + } + }, + '1.3.0-a': { + name: moduleName, + version: '1.3.0-a', + dist: { + shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', + tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.3.0-a.tgz' + } + } + } +} + +test('setup', function (t) { + npm.load(function () { + npm.config.set('loglevel', 'silly') + npm.registry = { + get: function (uri, opts, cb) { + setImmediate(function () { + cb(null, testModule, null, {statusCode: 200}) + }) + }, + fetch: function (u, opts, cb) { + setImmediate(function () { + var empty = new stream.Readable() + empty.push(null) + cb(null, empty) + }) + } + } + t.end() + }) +}) + +test('splat', function (t) { + t.plan(3) + 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) + }) +})