]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/realize-package-specifier/test/npa-bitbucket.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / realize-package-specifier / test / npa-bitbucket.js
1 var test = require("tap").test;
2 var rps = require("../index.js")
3 var path = require("path")
4
5 test("npa-bitbucket", function (t) {
6   t.setMaxListeners(999)
7
8   var tests = {
9     "bitbucket:user/foo-js": {
10       name: null,
11       type: "hosted",
12       hosted: { type: "bitbucket" },
13       spec: "bitbucket:user/foo-js",
14       raw: "bitbucket:user/foo-js"
15     },
16
17     "bitbucket:user/foo-js#bar/baz": {
18       name: null,
19       type: "hosted",
20       hosted: { type: "bitbucket" },
21       spec: "bitbucket:user/foo-js#bar/baz",
22       raw: "bitbucket:user/foo-js#bar/baz"
23     },
24
25     "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /": {
26       name: null,
27       type: "hosted",
28       hosted: { type: "bitbucket" },
29       spec: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /",
30       raw: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /"
31     },
32
33     "bitbucket:user/foo-js#bar/baz/bin": {
34       name: null,
35       type: "hosted",
36       hosted: { type: "bitbucket" },
37       spec: "bitbucket:user/foo-js#bar/baz/bin",
38       raw: "bitbucket:user/foo-js#bar/baz/bin"
39     },
40
41     "foo@bitbucket:user/foo-js": {
42       name: "foo",
43       type: "hosted",
44       hosted: { type: "bitbucket" },
45       spec: "bitbucket:user/foo-js",
46       raw: "foo@bitbucket:user/foo-js"
47     },
48
49     "git+ssh://git@bitbucket.org/user/foo#1.2.3": {
50       name: null,
51       type: "hosted",
52       hosted: { type: "bitbucket" },
53       spec: "git+ssh://git@bitbucket.org/user/foo.git#1.2.3",
54       raw: "git+ssh://git@bitbucket.org/user/foo#1.2.3"
55     },
56
57     "https://bitbucket.org/user/foo.git": {
58       name: null,
59       type: "hosted",
60       hosted: { type: "bitbucket" },
61       spec: "https://bitbucket.org/user/foo.git",
62       raw: "https://bitbucket.org/user/foo.git"
63     },
64
65     "@foo/bar@git+ssh://bitbucket.org/user/foo": {
66       name: "@foo/bar",
67       scope: "@foo",
68       type: "hosted",
69       hosted: { type: "bitbucket" },
70       spec: "git+ssh://git@bitbucket.org/user/foo.git",
71       rawSpec: "git+ssh://bitbucket.org/user/foo",
72       raw: "@foo/bar@git+ssh://bitbucket.org/user/foo"
73     }
74   }
75
76   t.plan( Object.keys(tests).length * 3 )
77
78   Object.keys(tests).forEach(function (arg) {
79     rps(arg, path.resolve(__dirname,'..'), function(err, res) {
80       t.notOk(err, "No error")
81       t.type(res, "Result")
82       t.has(res, tests[arg])
83     })
84   })
85
86 })