]> 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-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 / realize-package-specifier / test / npa-github.js
1 var test = require("tap").test;
2 var rps = require("../index.js")
3 var path = require("path")
4
5 test("npa-github", function (t) {
6   t.setMaxListeners(999)
7
8   var tests = {
9     "user/foo-js": {
10       name: null,
11       type: "hosted",
12       hosted: { type: "github" },
13       spec: "github:user/foo-js",
14       raw: "user/foo-js"
15     },
16
17     "user/foo-js#bar/baz": {
18       name: null,
19       type: "hosted",
20       hosted: { type: "github" },
21       spec: "github:user/foo-js#bar/baz",
22       raw: "user/foo-js#bar/baz"
23     },
24
25     "user..blerg--/..foo-js# . . . . . some . tags / / /": {
26       name: null,
27       type: "hosted",
28       hosted: { type: "github" },
29       spec: "github:user..blerg--/..foo-js# . . . . . some . tags / / /",
30       raw: "user..blerg--/..foo-js# . . . . . some . tags / / /"
31     },
32
33     "user/foo-js#bar/baz/bin": {
34       name: null,
35       type: "hosted",
36       hosted: { type: "github" },
37       spec: "github:user/foo-js#bar/baz/bin",
38       raw: "user/foo-js#bar/baz/bin"
39     },
40
41     "foo@user/foo-js": {
42       name: "foo",
43       type: "hosted",
44       hosted: { type: "github" },
45       spec: "github:user/foo-js",
46       raw: "foo@user/foo-js"
47     },
48
49     "github:user/foo-js": {
50       name: null,
51       type: "hosted",
52       hosted: { type: "github" },
53       spec: "github:user/foo-js",
54       raw: "github:user/foo-js"
55     },
56
57     "git+ssh://git@github.com/user/foo#1.2.3": {
58       name: null,
59       type: "hosted",
60       hosted: { type: "github" },
61       spec: "git+ssh://git@github.com/user/foo.git#1.2.3",
62       raw: "git+ssh://git@github.com/user/foo#1.2.3"
63     },
64
65     "git://github.com/user/foo": {
66       name: null,
67       type: "hosted",
68       hosted: { type: "github" },
69       spec: "git://github.com/user/foo.git",
70       raw: "git://github.com/user/foo"
71     },
72
73     "https://github.com/user/foo.git": {
74       name: null,
75       type: "hosted",
76       hosted: { type: "github" },
77       spec: "https://github.com/user/foo.git",
78       raw: "https://github.com/user/foo.git"
79     },
80
81     "@foo/bar@git+ssh://github.com/user/foo": {
82       name: "@foo/bar",
83       scope: "@foo",
84       type: "hosted",
85       hosted: { type: "github" },
86       spec: "git+ssh://git@github.com/user/foo.git",
87       rawSpec: "git+ssh://github.com/user/foo",
88       raw: "@foo/bar@git+ssh://github.com/user/foo"
89     },
90
91    "foo@bar/foo": {
92      name: "foo",
93      type: "hosted",
94       hosted: { type: "github" },
95      spec: "github:bar/foo",
96      raw: "foo@bar/foo"
97    }
98   }
99
100   t.plan( Object.keys(tests).length * 3 )
101
102   Object.keys(tests).forEach(function (arg) {
103     rps(arg, path.resolve(__dirname,'..'), function(err, res) {
104       t.notOk(err, "No error")
105       t.type(res, "Result")
106       t.has(res, tests[arg])
107     })
108   })
109
110 })