• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-dev-dep"),
9    {
10      log: console.error,
11      dev: true
12    },
13    function (err, map) {
14      t.ifError(err, "read-installed made it")
15
16      t.notOk(map.dependencies.d.extraneous, "d is not extraneous, it's required by root")
17      t.ok(map.dependencies.x.extraneous, "x is extraneous, it's only a dev dep of d")
18      t.end()
19    })
20})
21