2 var test = require('tap').test
3 var npm = require('../../lib/npm')
4 var stream = require('readable-stream')
7 require('../common-tap.js')
9 var moduleName = 'xyzzy-wibble'
20 shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709',
21 tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.0.0-a.tgz'
28 shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709',
29 tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.1.0-a.tgz'
36 shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709',
37 tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.2.0-a.tgz'
44 shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709',
45 tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.3.0-a.tgz'
51 test('setup', function (t) {
52 npm.load(function () {
53 npm.config.set('loglevel', 'silly')
55 get: function (uri, opts, cb) {
56 setImmediate(function () {
57 cb(null, testModule, null, {statusCode: 200})
60 fetch: function (u, opts, cb) {
61 setImmediate(function () {
62 var empty = new stream.Readable()
72 test('splat', function (t) {
74 var addNamed = require('../../lib/cache/add-named.js')
75 addNamed('xyzzy-wibble', '*', testModule, function (err, pkg) {
76 t.error(err, 'Succesfully resolved a splat package')
77 t.is(pkg.name, moduleName)
78 t.is(pkg.version, testModule['dist-tags'].latest)