1 var test = require("tap").test;
2 var rps = require("../index.js")
3 var path = require("path")
5 test("npa-github", function (t) {
12 hosted: { type: "github" },
13 spec: "github:user/foo-js",
17 "user/foo-js#bar/baz": {
20 hosted: { type: "github" },
21 spec: "github:user/foo-js#bar/baz",
22 raw: "user/foo-js#bar/baz"
25 "user..blerg--/..foo-js# . . . . . some . tags / / /": {
28 hosted: { type: "github" },
29 spec: "github:user..blerg--/..foo-js# . . . . . some . tags / / /",
30 raw: "user..blerg--/..foo-js# . . . . . some . tags / / /"
33 "user/foo-js#bar/baz/bin": {
36 hosted: { type: "github" },
37 spec: "github:user/foo-js#bar/baz/bin",
38 raw: "user/foo-js#bar/baz/bin"
44 hosted: { type: "github" },
45 spec: "github:user/foo-js",
46 raw: "foo@user/foo-js"
49 "github:user/foo-js": {
52 hosted: { type: "github" },
53 spec: "github:user/foo-js",
54 raw: "github:user/foo-js"
57 "git+ssh://git@github.com/user/foo#1.2.3": {
60 hosted: { type: "github" },
61 spec: "git+ssh://git@github.com/user/foo.git#1.2.3",
62 raw: "git+ssh://git@github.com/user/foo#1.2.3"
65 "git://github.com/user/foo": {
68 hosted: { type: "github" },
69 spec: "git://github.com/user/foo.git",
70 raw: "git://github.com/user/foo"
73 "https://github.com/user/foo.git": {
76 hosted: { type: "github" },
77 spec: "https://github.com/user/foo.git",
78 raw: "https://github.com/user/foo.git"
81 "@foo/bar@git+ssh://github.com/user/foo": {
85 hosted: { type: "github" },
86 spec: "git+ssh://git@github.com/user/foo.git",
87 rawSpec: "git+ssh://github.com/user/foo",
88 raw: "@foo/bar@git+ssh://github.com/user/foo"
94 hosted: { type: "github" },
95 spec: "github:bar/foo",
100 t.plan( Object.keys(tests).length * 3 )
102 Object.keys(tests).forEach(function (arg) {
103 rps(arg, path.resolve(__dirname,'..'), function(err, res) {
104 t.notOk(err, "No error")
105 t.type(res, "Result")
106 t.has(res, tests[arg])