1 var test = require("tap").test;
2 var rps = require("../index.js")
3 var path = require("path")
5 test("npa-gitlab", function (t) {
9 "gitlab:user/foo-js": {
12 hosted: { type: "gitlab" },
13 spec: "gitlab:user/foo-js",
14 raw: "gitlab:user/foo-js"
17 "gitlab:user/foo-js#bar/baz": {
20 hosted: { type: "gitlab" },
21 spec: "gitlab:user/foo-js#bar/baz",
22 raw: "gitlab:user/foo-js#bar/baz"
25 "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /": {
28 hosted: { type: "gitlab" },
29 spec: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /",
30 raw: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /"
33 "gitlab:user/foo-js#bar/baz/bin": {
36 hosted: { type: "gitlab" },
37 spec: "gitlab:user/foo-js#bar/baz/bin",
38 raw: "gitlab:user/foo-js#bar/baz/bin"
41 "foo@gitlab:user/foo-js": {
44 hosted: { type: "gitlab" },
45 spec: "gitlab:user/foo-js",
46 raw: "foo@gitlab:user/foo-js"
49 "git+ssh://git@gitlab.com/user/foo#1.2.3": {
52 hosted: { type: "gitlab" },
53 spec: "git+ssh://git@gitlab.com/user/foo.git#1.2.3",
54 raw: "git+ssh://git@gitlab.com/user/foo#1.2.3"
57 "https://gitlab.com/user/foo.git": {
60 hosted: { type: "gitlab" },
61 spec: "https://gitlab.com/user/foo.git",
62 raw: "https://gitlab.com/user/foo.git"
65 "@foo/bar@git+ssh://gitlab.com/user/foo": {
69 hosted: { type: "gitlab" },
70 spec: "git+ssh://git@gitlab.com/user/foo.git",
71 rawSpec: "git+ssh://gitlab.com/user/foo",
72 raw: "@foo/bar@git+ssh://gitlab.com/user/foo"
76 t.plan( Object.keys(tests).length * 3 )
78 Object.keys(tests).forEach(function (arg) {
79 rps(arg, path.resolve(__dirname,'..'), function(err, res) {
80 t.notOk(err, "No error")
82 t.has(res, tests[arg])