X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Fnode_modules%2Frealize-package-specifier%2Ftest%2Fnpa-gitlab.js;fp=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Fnode_modules%2Frealize-package-specifier%2Ftest%2Fnpa-gitlab.js;h=cb1a625bc25bef450d05cc60ece4bd134b2ff984;hb=2529be6d456deeb07c128603ce4971f1dc29b695;hp=0000000000000000000000000000000000000000;hpb=2636fc31c16c23711cf2b06a4ae8537bba9c1d35;p=simantics%2Fdistrict.git diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/realize-package-specifier/test/npa-gitlab.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/realize-package-specifier/test/npa-gitlab.js new file mode 100644 index 00000000..cb1a625b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/realize-package-specifier/test/npa-gitlab.js @@ -0,0 +1,86 @@ +var test = require("tap").test; +var rps = require("../index.js") +var path = require("path") + +test("npa-gitlab", function (t) { + t.setMaxListeners(999) + + var tests = { + "gitlab:user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user/foo-js", + raw: "gitlab:user/foo-js" + }, + + "gitlab:user/foo-js#bar/baz": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user/foo-js#bar/baz", + raw: "gitlab:user/foo-js#bar/baz" + }, + + "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /", + raw: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "gitlab:user/foo-js#bar/baz/bin": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user/foo-js#bar/baz/bin", + raw: "gitlab:user/foo-js#bar/baz/bin" + }, + + "foo@gitlab:user/foo-js": { + name: "foo", + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user/foo-js", + raw: "foo@gitlab:user/foo-js" + }, + + "git+ssh://git@gitlab.com/user/foo#1.2.3": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo.git#1.2.3", + raw: "git+ssh://git@gitlab.com/user/foo#1.2.3" + }, + + "https://gitlab.com/user/foo.git": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "https://gitlab.com/user/foo.git", + raw: "https://gitlab.com/user/foo.git" + }, + + "@foo/bar@git+ssh://gitlab.com/user/foo": { + name: "@foo/bar", + scope: "@foo", + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo.git", + rawSpec: "git+ssh://gitlab.com/user/foo", + raw: "@foo/bar@git+ssh://gitlab.com/user/foo" + } + } + + t.plan( Object.keys(tests).length * 3 ) + + Object.keys(tests).forEach(function (arg) { + rps(arg, path.resolve(__dirname,'..'), function(err, res) { + t.notOk(err, "No error") + t.type(res, "Result") + t.has(res, tests[arg]) + }) + }) + +})