2014-03-20 00:25:40 +08:00
|
|
|
var readInstalled = require('../read-installed.js')
|
|
|
|
var test = require('tap').test
|
2014-09-25 05:41:07 +08:00
|
|
|
var path = require('path')
|
2014-03-20 00:25:40 +08:00
|
|
|
|
|
|
|
test('extraneous detected', function(t) {
|
|
|
|
// This test verifies read-installed#16
|
|
|
|
readInstalled(
|
|
|
|
path.join(__dirname, 'fixtures/extraneous-detected'),
|
|
|
|
{ log: console.error },
|
|
|
|
function(err, map) {
|
|
|
|
t.ok(map.dependencies.foo.extraneous, 'foo is extraneous, it\'s not required by any module')
|
|
|
|
t.ok(map.dependencies.bar.extraneous, 'bar is extraneous, it\'s not required by any module')
|
|
|
|
t.notOk(map.dependencies.asdf.extraneous, 'asdf is not extraneous, it\'s required by ghjk')
|
|
|
|
t.notOk(map.dependencies.ghjk.extraneous, 'ghjk is not extraneous, it\'s required by our root module')
|
2014-09-25 05:41:07 +08:00
|
|
|
t.end()
|
2014-03-20 00:25:40 +08:00
|
|
|
})
|
|
|
|
})
|