The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / deps / npm / test / tap / false_name.js @ 5aef65a9

History | View | Annotate | Download (735 Bytes)

1
var test = require("tap").test
2
  , fs = require("fs")
3
  , path = require("path")
4
  , existsSync = fs.existsSync || path.existsSync
5
  , spawn = require("child_process").spawn
6
  , npm = require("../../")
7
  , rimraf = require("rimraf")
8

    
9
test("not every pkg.name can be required", function (t) {
10
  t.plan(1)
11

    
12
  setup(function () {
13
    npm.install(".", function (err) {
14
      if (err) return t.fail(err)
15
      t.ok(existsSync(__dirname +
16
        "/false_name/node_modules/tap/node_modules/buffer-equal"))
17
    })
18
  })
19
})
20

    
21
function setup (cb) {
22
  process.chdir(__dirname + "/false_name")
23
  npm.load(function () {
24
    rimraf.sync(__dirname + "/false_name/node_modules")
25
    fs.mkdirSync(__dirname + "/false_name/node_modules")
26
    cb()
27
  })
28
}