]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/github.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / npm-package-arg / test / github.js
1 var npa = require("../npa.js")
2 var path = require("path")
3
4 require("tap").test("basic", function (t) {
5   t.setMaxListeners(999)
6
7   var tests = {
8     "user/foo-js": {
9       name: null,
10       type: "hosted",
11       hosted: { type: "github" },
12       spec: "github:user/foo-js",
13       raw: "user/foo-js"
14     },
15
16     "user/foo-js#bar/baz": {
17       name: null,
18       type: "hosted",
19       hosted: { type: "github" },
20       spec: "github:user/foo-js#bar/baz",
21       raw: "user/foo-js#bar/baz"
22     },
23
24     "user..blerg--/..foo-js# . . . . . some . tags / / /": {
25       name: null,
26       type: "hosted",
27       hosted: { type: "github" },
28       spec: "github:user..blerg--/..foo-js# . . . . . some . tags / / /",
29       raw: "user..blerg--/..foo-js# . . . . . some . tags / / /"
30     },
31
32     "user/foo-js#bar/baz/bin": {
33       name: null,
34       type: "hosted",
35       hosted: { type: "github" },
36       raw: "github:user/foo-js#bar/baz/bin",
37       raw: "user/foo-js#bar/baz/bin"
38     },
39
40     "foo@user/foo-js": {
41       name: "foo",
42       type: "hosted",
43       hosted: { type: "github" },
44       spec: "github:user/foo-js",
45       raw: "foo@user/foo-js"
46     },
47
48     "github:user/foo-js": {
49       name: null,
50       type: "hosted",
51       hosted: { type: "github" },
52       spec: "github:user/foo-js",
53       raw: "github:user/foo-js"
54     },
55
56     "git+ssh://git@github.com/user/foo#1.2.3": {
57       name: null,
58       type: "hosted",
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"
62     },
63
64     "git://github.com/user/foo": {
65       name: null,
66       type: "hosted",
67       hosted: { type: "github" },
68       spec: "git://github.com/user/foo.git",
69       raw: "git://github.com/user/foo"
70     },
71
72     "https://github.com/user/foo.git": {
73       name: null,
74       type: "hosted",
75       hosted: { type: "github" },
76       spec: "git+https://github.com/user/foo.git",
77       raw: "https://github.com/user/foo.git"
78     },
79
80     "@foo/bar@git+ssh://github.com/user/foo": {
81       name: "@foo/bar",
82       scope: "@foo",
83       type: "hosted",
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"
88     },
89
90    "foo@bar/foo": {
91      name: "foo",
92      type: "hosted",
93      hosted: { type: "github" },
94      spec: "github:bar/foo",
95      raw: "foo@bar/foo"
96    }
97   }
98
99   Object.keys(tests).forEach(function (arg) {
100     var res = npa(arg)
101     t.type(res, "Result", arg + " is a result")
102     t.has(res, tests[arg], arg + " matches expectations")
103   })
104
105   t.end()
106 })