1 // taken from https://raw.githubusercontent.com/indexzero/npm/bd3cad01fbd3ab481d2f5da441b9eead16029123/test/tap/config-nerf-dart.js
2 // originally written by Charlie Robbins, https://github.com/indexzero
3 var test = require("tap").test
4 var toNerfDart = require("../../lib/config/nerf-dart.js")
6 function validNerfDart (uri, valid) {
7 if (!valid) valid = "//registry.npmjs.org/"
8 test(uri, function (t) {
9 t.equal(toNerfDart(uri), valid)
14 validNerfDart("http://registry.npmjs.org")
15 validNerfDart("http://registry.npmjs.org/some-package")
16 validNerfDart("http://registry.npmjs.org/some-package?write=true")
17 validNerfDart("http://user:pass@registry.npmjs.org/some-package?write=true")
18 validNerfDart("http://registry.npmjs.org/#random-hash")
19 validNerfDart("http://registry.npmjs.org/some-package#random-hash")
22 "http://relative.couchapp.npm/design/-/rewrite/",
23 "//relative.couchapp.npm/design/-/rewrite/"
26 "http://relative.couchapp.npm:8080/design/-/rewrite/",
27 "//relative.couchapp.npm:8080/design/-/rewrite/"
30 "http://relative.couchapp.npm:8080/design/-/rewrite/some-package",
31 "//relative.couchapp.npm:8080/design/-/rewrite/"