1var readInstalled = require('../read-installed.js') 2var test = require('tap').test 3var path = require('path') 4 5test('extraneous detected', function(t) { 6 // This test verifies read-installed#16 7 readInstalled( 8 path.join(__dirname, 'fixtures/extraneous-detected'), 9 { log: console.error }, 10 function(err, map) { 11 t.ok(map.dependencies.foo.extraneous, 'foo is extraneous, it\'s not required by any module') 12 t.ok(map.dependencies.bar.extraneous, 'bar is extraneous, it\'s not required by any module') 13 t.notOk(map.dependencies.asdf.extraneous, 'asdf is not extraneous, it\'s required by ghjk') 14 t.notOk(map.dependencies.ghjk.extraneous, 'ghjk is not extraneous, it\'s required by our root module') 15 t.end() 16 }) 17}) 18