1 var npa = require("../npa.js")
2 var path = require("path")
4 require("tap").test("basic", function (t) {
11 hosted: { type: "github" },
12 spec: "github:user/foo-js",
16 "user/foo-js#bar/baz": {
19 hosted: { type: "github" },
20 spec: "github:user/foo-js#bar/baz",
21 raw: "user/foo-js#bar/baz"
24 "user..blerg--/..foo-js# . . . . . some . tags / / /": {
27 hosted: { type: "github" },
28 spec: "github:user..blerg--/..foo-js# . . . . . some . tags / / /",
29 raw: "user..blerg--/..foo-js# . . . . . some . tags / / /"
32 "user/foo-js#bar/baz/bin": {
35 hosted: { type: "github" },
36 raw: "github:user/foo-js#bar/baz/bin",
37 raw: "user/foo-js#bar/baz/bin"
43 hosted: { type: "github" },
44 spec: "github:user/foo-js",
45 raw: "foo@user/foo-js"
48 "github:user/foo-js": {
51 hosted: { type: "github" },
52 spec: "github:user/foo-js",
53 raw: "github:user/foo-js"
56 "git+ssh://git@github.com/user/foo#1.2.3": {
59 hosted: { type: "github" },
60 spec: "git+ssh://git@github.com/user/foo.git#1.2.3",
61 raw: "git+ssh://git@github.com/user/foo#1.2.3"
64 "git://github.com/user/foo": {
67 hosted: { type: "github" },
68 spec: "git://github.com/user/foo.git",
69 raw: "git://github.com/user/foo"
72 "https://github.com/user/foo.git": {
75 hosted: { type: "github" },
76 spec: "git+https://github.com/user/foo.git",
77 raw: "https://github.com/user/foo.git"
80 "@foo/bar@git+ssh://github.com/user/foo": {
84 hosted: { type: "github" },
85 spec: "git+ssh://git@github.com/user/foo.git",
86 rawSpec: "git+ssh://github.com/user/foo",
87 raw: "@foo/bar@git+ssh://github.com/user/foo"
93 hosted: { type: "github" },
94 spec: "github:bar/foo",
99 Object.keys(tests).forEach(function (arg) {
101 t.type(res, "Result", arg + " is a result")
102 t.has(res, tests[arg], arg + " matches expectations")