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%2Fnpm-package-arg%2Ftest%2Fbitbucket.js;fp=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Fnode_modules%2Fnpm-package-arg%2Ftest%2Fbitbucket.js;h=1dff34ffa8afb902650a315c92e36483cfd5efb4;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/npm-package-arg/test/bitbucket.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/bitbucket.js new file mode 100644 index 00000000..1dff34ff --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/bitbucket.js @@ -0,0 +1,82 @@ +var npa = require("../npa.js") +var path = require("path") + +require("tap").test("basic", function (t) { + t.setMaxListeners(999) + + var tests = { + "bitbucket:user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js", + raw: "bitbucket:user/foo-js" + }, + + "bitbucket:user/foo-js#bar/baz": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js#bar/baz", + raw: "bitbucket:user/foo-js#bar/baz" + }, + + "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /", + raw: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "bitbucket:user/foo-js#bar/baz/bin": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js#bar/baz/bin", + raw: "bitbucket:user/foo-js#bar/baz/bin" + }, + + "foo@bitbucket:user/foo-js": { + name: "foo", + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js", + raw: "foo@bitbucket:user/foo-js" + }, + + "git+ssh://git@bitbucket.org/user/foo#1.2.3": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo.git#1.2.3", + raw: "git+ssh://git@bitbucket.org/user/foo#1.2.3" + }, + + "https://bitbucket.org/user/foo.git": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+https://bitbucket.org/user/foo.git", + raw: "https://bitbucket.org/user/foo.git" + }, + + "@foo/bar@git+ssh://bitbucket.org/user/foo": { + name: "@foo/bar", + scope: "@foo", + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo.git", + rawSpec: "git+ssh://bitbucket.org/user/foo", + raw: "@foo/bar@git+ssh://bitbucket.org/user/foo" + } + } + + Object.keys(tests).forEach(function (arg) { + var res = npa(arg) + t.type(res, "Result", arg + " is a result") + t.has(res, tests[arg], arg + " matches expectations") + }) + + t.end() +})