cdk-common 2.0.966 → 2.0.967

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,27 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const {
4
- ok,
5
- same: deepEqual,
6
- strictSame: strictEqual,
7
- notSame: notStrictEqual,
8
- test: tapTest
9
- } = require('tap')
10
-
11
- const test = function () {
12
- if (typeof arguments[2] === 'function') {
13
- tapTest(arguments[0], arguments[1], t => {
14
- arguments[2](t)
15
- t.end()
16
- })
17
- } else {
18
- tapTest(arguments[0], t => {
19
- arguments[1](t)
20
- t.end()
21
- })
22
- }
23
- }
24
-
3
+ const test = require('tape')
25
4
  const URI = require('../index')
26
5
 
27
6
  /**
@@ -60,260 +39,249 @@ const URI = require('../index')
60
39
  * or implied, of Gary Court.
61
40
  */
62
41
 
63
- test('Acquire URI', function () {
64
- // URI = require("./uri").URI;
65
- ok(URI)
42
+ test('Acquire URI', (t) => {
43
+ t.ok(URI)
44
+ t.end()
66
45
  })
67
46
 
68
- test('URI Parsing', function () {
47
+ test('URI Parsing', (t) => {
69
48
  let components
70
49
 
71
50
  // scheme
72
51
  components = URI.parse('uri:')
73
- strictEqual(components.error, undefined, 'scheme errors')
74
- strictEqual(components.scheme, 'uri', 'scheme')
75
- // strictEqual(components.authority, undefined, "authority");
76
- strictEqual(components.userinfo, undefined, 'userinfo')
77
- strictEqual(components.host, undefined, 'host')
78
- strictEqual(components.port, undefined, 'port')
79
- strictEqual(components.path, '', 'path')
80
- strictEqual(components.query, undefined, 'query')
81
- strictEqual(components.fragment, undefined, 'fragment')
52
+ t.equal(components.error, undefined, 'scheme errors')
53
+ t.equal(components.scheme, 'uri', 'scheme')
54
+ t.equal(components.userinfo, undefined, 'userinfo')
55
+ t.equal(components.host, undefined, 'host')
56
+ t.equal(components.port, undefined, 'port')
57
+ t.equal(components.path, '', 'path')
58
+ t.equal(components.query, undefined, 'query')
59
+ t.equal(components.fragment, undefined, 'fragment')
82
60
 
83
61
  // userinfo
84
62
  components = URI.parse('//@')
85
- strictEqual(components.error, undefined, 'userinfo errors')
86
- strictEqual(components.scheme, undefined, 'scheme')
87
- // strictEqual(components.authority, "@", "authority");
88
- strictEqual(components.userinfo, '', 'userinfo')
89
- strictEqual(components.host, '', 'host')
90
- strictEqual(components.port, undefined, 'port')
91
- strictEqual(components.path, '', 'path')
92
- strictEqual(components.query, undefined, 'query')
93
- strictEqual(components.fragment, undefined, 'fragment')
63
+ t.equal(components.error, undefined, 'userinfo errors')
64
+ t.equal(components.scheme, undefined, 'scheme')
65
+ t.equal(components.userinfo, '', 'userinfo')
66
+ t.equal(components.host, '', 'host')
67
+ t.equal(components.port, undefined, 'port')
68
+ t.equal(components.path, '', 'path')
69
+ t.equal(components.query, undefined, 'query')
70
+ t.equal(components.fragment, undefined, 'fragment')
94
71
 
95
72
  // host
96
73
  components = URI.parse('//')
97
- strictEqual(components.error, undefined, 'host errors')
98
- strictEqual(components.scheme, undefined, 'scheme')
99
- // strictEqual(components.authority, "", "authority");
100
- strictEqual(components.userinfo, undefined, 'userinfo')
101
- strictEqual(components.host, '', 'host')
102
- strictEqual(components.port, undefined, 'port')
103
- strictEqual(components.path, '', 'path')
104
- strictEqual(components.query, undefined, 'query')
105
- strictEqual(components.fragment, undefined, 'fragment')
74
+ t.equal(components.error, undefined, 'host errors')
75
+ t.equal(components.scheme, undefined, 'scheme')
76
+ t.equal(components.userinfo, undefined, 'userinfo')
77
+ t.equal(components.host, '', 'host')
78
+ t.equal(components.port, undefined, 'port')
79
+ t.equal(components.path, '', 'path')
80
+ t.equal(components.query, undefined, 'query')
81
+ t.equal(components.fragment, undefined, 'fragment')
106
82
 
107
83
  // port
108
84
  components = URI.parse('//:')
109
- strictEqual(components.error, undefined, 'port errors')
110
- strictEqual(components.scheme, undefined, 'scheme')
111
- // strictEqual(components.authority, ":", "authority");
112
- strictEqual(components.userinfo, undefined, 'userinfo')
113
- strictEqual(components.host, '', 'host')
114
- strictEqual(components.port, '', 'port')
115
- strictEqual(components.path, '', 'path')
116
- strictEqual(components.query, undefined, 'query')
117
- strictEqual(components.fragment, undefined, 'fragment')
85
+ t.equal(components.error, undefined, 'port errors')
86
+ t.equal(components.scheme, undefined, 'scheme')
87
+ t.equal(components.userinfo, undefined, 'userinfo')
88
+ t.equal(components.host, '', 'host')
89
+ t.equal(components.port, '', 'port')
90
+ t.equal(components.path, '', 'path')
91
+ t.equal(components.query, undefined, 'query')
92
+ t.equal(components.fragment, undefined, 'fragment')
118
93
 
119
94
  // path
120
95
  components = URI.parse('')
121
- strictEqual(components.error, undefined, 'path errors')
122
- strictEqual(components.scheme, undefined, 'scheme')
123
- // strictEqual(components.authority, undefined, "authority");
124
- strictEqual(components.userinfo, undefined, 'userinfo')
125
- strictEqual(components.host, undefined, 'host')
126
- strictEqual(components.port, undefined, 'port')
127
- strictEqual(components.path, '', 'path')
128
- strictEqual(components.query, undefined, 'query')
129
- strictEqual(components.fragment, undefined, 'fragment')
96
+ t.equal(components.error, undefined, 'path errors')
97
+ t.equal(components.scheme, undefined, 'scheme')
98
+ t.equal(components.userinfo, undefined, 'userinfo')
99
+ t.equal(components.host, undefined, 'host')
100
+ t.equal(components.port, undefined, 'port')
101
+ t.equal(components.path, '', 'path')
102
+ t.equal(components.query, undefined, 'query')
103
+ t.equal(components.fragment, undefined, 'fragment')
130
104
 
131
105
  // query
132
106
  components = URI.parse('?')
133
- strictEqual(components.error, undefined, 'query errors')
134
- strictEqual(components.scheme, undefined, 'scheme')
135
- // strictEqual(components.authority, undefined, "authority");
136
- strictEqual(components.userinfo, undefined, 'userinfo')
137
- strictEqual(components.host, undefined, 'host')
138
- strictEqual(components.port, undefined, 'port')
139
- strictEqual(components.path, '', 'path')
140
- strictEqual(components.query, '', 'query')
141
- strictEqual(components.fragment, undefined, 'fragment')
107
+ t.equal(components.error, undefined, 'query errors')
108
+ t.equal(components.scheme, undefined, 'scheme')
109
+ t.equal(components.userinfo, undefined, 'userinfo')
110
+ t.equal(components.host, undefined, 'host')
111
+ t.equal(components.port, undefined, 'port')
112
+ t.equal(components.path, '', 'path')
113
+ t.equal(components.query, '', 'query')
114
+ t.equal(components.fragment, undefined, 'fragment')
142
115
 
143
116
  // fragment
144
117
  components = URI.parse('#')
145
- strictEqual(components.error, undefined, 'fragment errors')
146
- strictEqual(components.scheme, undefined, 'scheme')
147
- // strictEqual(components.authority, undefined, "authority");
148
- strictEqual(components.userinfo, undefined, 'userinfo')
149
- strictEqual(components.host, undefined, 'host')
150
- strictEqual(components.port, undefined, 'port')
151
- strictEqual(components.path, '', 'path')
152
- strictEqual(components.query, undefined, 'query')
153
- strictEqual(components.fragment, '', 'fragment')
118
+ t.equal(components.error, undefined, 'fragment errors')
119
+ t.equal(components.scheme, undefined, 'scheme')
120
+ t.equal(components.userinfo, undefined, 'userinfo')
121
+ t.equal(components.host, undefined, 'host')
122
+ t.equal(components.port, undefined, 'port')
123
+ t.equal(components.path, '', 'path')
124
+ t.equal(components.query, undefined, 'query')
125
+ t.equal(components.fragment, '', 'fragment')
154
126
 
155
127
  // fragment with character tabulation
156
128
  components = URI.parse('#\t')
157
- strictEqual(components.error, undefined, 'path errors')
158
- strictEqual(components.scheme, undefined, 'scheme')
159
- // strictEqual(components.authority, undefined, "authority");
160
- strictEqual(components.userinfo, undefined, 'userinfo')
161
- strictEqual(components.host, undefined, 'host')
162
- strictEqual(components.port, undefined, 'port')
163
- strictEqual(components.path, '', 'path')
164
- strictEqual(components.query, undefined, 'query')
165
- strictEqual(components.fragment, '%09', 'fragment')
129
+ t.equal(components.error, undefined, 'path errors')
130
+ t.equal(components.scheme, undefined, 'scheme')
131
+ t.equal(components.userinfo, undefined, 'userinfo')
132
+ t.equal(components.host, undefined, 'host')
133
+ t.equal(components.port, undefined, 'port')
134
+ t.equal(components.path, '', 'path')
135
+ t.equal(components.query, undefined, 'query')
136
+ t.equal(components.fragment, '%09', 'fragment')
166
137
 
167
138
  // fragment with line feed
168
139
  components = URI.parse('#\n')
169
- strictEqual(components.error, undefined, 'path errors')
170
- strictEqual(components.scheme, undefined, 'scheme')
171
- // strictEqual(components.authority, undefined, "authority");
172
- strictEqual(components.userinfo, undefined, 'userinfo')
173
- strictEqual(components.host, undefined, 'host')
174
- strictEqual(components.port, undefined, 'port')
175
- strictEqual(components.path, '', 'path')
176
- strictEqual(components.query, undefined, 'query')
177
- strictEqual(components.fragment, '%0A', 'fragment')
140
+ t.equal(components.error, undefined, 'path errors')
141
+ t.equal(components.scheme, undefined, 'scheme')
142
+ t.equal(components.userinfo, undefined, 'userinfo')
143
+ t.equal(components.host, undefined, 'host')
144
+ t.equal(components.port, undefined, 'port')
145
+ t.equal(components.path, '', 'path')
146
+ t.equal(components.query, undefined, 'query')
147
+ t.equal(components.fragment, '%0A', 'fragment')
178
148
 
179
149
  // fragment with line tabulation
180
150
  components = URI.parse('#\v')
181
- strictEqual(components.error, undefined, 'path errors')
182
- strictEqual(components.scheme, undefined, 'scheme')
183
- // strictEqual(components.authority, undefined, "authority");
184
- strictEqual(components.userinfo, undefined, 'userinfo')
185
- strictEqual(components.host, undefined, 'host')
186
- strictEqual(components.port, undefined, 'port')
187
- strictEqual(components.path, '', 'path')
188
- strictEqual(components.query, undefined, 'query')
189
- strictEqual(components.fragment, '%0B', 'fragment')
151
+ t.equal(components.error, undefined, 'path errors')
152
+ t.equal(components.scheme, undefined, 'scheme')
153
+ t.equal(components.userinfo, undefined, 'userinfo')
154
+ t.equal(components.host, undefined, 'host')
155
+ t.equal(components.port, undefined, 'port')
156
+ t.equal(components.path, '', 'path')
157
+ t.equal(components.query, undefined, 'query')
158
+ t.equal(components.fragment, '%0B', 'fragment')
190
159
 
191
160
  // fragment with form feed
192
161
  components = URI.parse('#\f')
193
- strictEqual(components.error, undefined, 'path errors')
194
- strictEqual(components.scheme, undefined, 'scheme')
195
- // strictEqual(components.authority, undefined, "authority");
196
- strictEqual(components.userinfo, undefined, 'userinfo')
197
- strictEqual(components.host, undefined, 'host')
198
- strictEqual(components.port, undefined, 'port')
199
- strictEqual(components.path, '', 'path')
200
- strictEqual(components.query, undefined, 'query')
201
- strictEqual(components.fragment, '%0C', 'fragment')
162
+ t.equal(components.error, undefined, 'path errors')
163
+ t.equal(components.scheme, undefined, 'scheme')
164
+ t.equal(components.userinfo, undefined, 'userinfo')
165
+ t.equal(components.host, undefined, 'host')
166
+ t.equal(components.port, undefined, 'port')
167
+ t.equal(components.path, '', 'path')
168
+ t.equal(components.query, undefined, 'query')
169
+ t.equal(components.fragment, '%0C', 'fragment')
202
170
 
203
171
  // fragment with carriage return
204
172
  components = URI.parse('#\r')
205
- strictEqual(components.error, undefined, 'path errors')
206
- strictEqual(components.scheme, undefined, 'scheme')
207
- // strictEqual(components.authority, undefined, "authority");
208
- strictEqual(components.userinfo, undefined, 'userinfo')
209
- strictEqual(components.host, undefined, 'host')
210
- strictEqual(components.port, undefined, 'port')
211
- strictEqual(components.path, '', 'path')
212
- strictEqual(components.query, undefined, 'query')
213
- strictEqual(components.fragment, '%0D', 'fragment')
173
+ t.equal(components.error, undefined, 'path errors')
174
+ t.equal(components.scheme, undefined, 'scheme')
175
+ t.equal(components.userinfo, undefined, 'userinfo')
176
+ t.equal(components.host, undefined, 'host')
177
+ t.equal(components.port, undefined, 'port')
178
+ t.equal(components.path, '', 'path')
179
+ t.equal(components.query, undefined, 'query')
180
+ t.equal(components.fragment, '%0D', 'fragment')
214
181
 
215
182
  // all
216
183
  components = URI.parse('uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body')
217
- strictEqual(components.error, undefined, 'all errors')
218
- strictEqual(components.scheme, 'uri', 'scheme')
219
- // strictEqual(components.authority, "user:pass@example.com:123", "authority");
220
- strictEqual(components.userinfo, 'user:pass', 'userinfo')
221
- strictEqual(components.host, 'example.com', 'host')
222
- strictEqual(components.port, 123, 'port')
223
- strictEqual(components.path, '/one/two.three', 'path')
224
- strictEqual(components.query, 'q1=a1&q2=a2', 'query')
225
- strictEqual(components.fragment, 'body', 'fragment')
184
+ t.equal(components.error, undefined, 'all errors')
185
+ t.equal(components.scheme, 'uri', 'scheme')
186
+ t.equal(components.userinfo, 'user:pass', 'userinfo')
187
+ t.equal(components.host, 'example.com', 'host')
188
+ t.equal(components.port, 123, 'port')
189
+ t.equal(components.path, '/one/two.three', 'path')
190
+ t.equal(components.query, 'q1=a1&q2=a2', 'query')
191
+ t.equal(components.fragment, 'body', 'fragment')
226
192
 
227
193
  // IPv4address
228
194
  components = URI.parse('//10.10.10.10')
229
- strictEqual(components.error, undefined, 'IPv4address errors')
230
- strictEqual(components.scheme, undefined, 'scheme')
231
- strictEqual(components.userinfo, undefined, 'userinfo')
232
- strictEqual(components.host, '10.10.10.10', 'host')
233
- strictEqual(components.port, undefined, 'port')
234
- strictEqual(components.path, '', 'path')
235
- strictEqual(components.query, undefined, 'query')
236
- strictEqual(components.fragment, undefined, 'fragment')
195
+ t.equal(components.error, undefined, 'IPv4address errors')
196
+ t.equal(components.scheme, undefined, 'scheme')
197
+ t.equal(components.userinfo, undefined, 'userinfo')
198
+ t.equal(components.host, '10.10.10.10', 'host')
199
+ t.equal(components.port, undefined, 'port')
200
+ t.equal(components.path, '', 'path')
201
+ t.equal(components.query, undefined, 'query')
202
+ t.equal(components.fragment, undefined, 'fragment')
237
203
 
238
204
  // IPv6address
239
205
  components = URI.parse('//[2001:db8::7]')
240
- strictEqual(components.error, undefined, 'IPv4address errors')
241
- strictEqual(components.scheme, undefined, 'scheme')
242
- strictEqual(components.userinfo, undefined, 'userinfo')
243
- strictEqual(components.host, '2001:db8::7', 'host')
244
- strictEqual(components.port, undefined, 'port')
245
- strictEqual(components.path, '', 'path')
246
- strictEqual(components.query, undefined, 'query')
247
- strictEqual(components.fragment, undefined, 'fragment')
206
+ t.equal(components.error, undefined, 'IPv4address errors')
207
+ t.equal(components.scheme, undefined, 'scheme')
208
+ t.equal(components.userinfo, undefined, 'userinfo')
209
+ t.equal(components.host, '2001:db8::7', 'host')
210
+ t.equal(components.port, undefined, 'port')
211
+ t.equal(components.path, '', 'path')
212
+ t.equal(components.query, undefined, 'query')
213
+ t.equal(components.fragment, undefined, 'fragment')
248
214
 
249
215
  // mixed IPv4address & IPv6address
250
216
  components = URI.parse('//[::ffff:129.144.52.38]')
251
- strictEqual(components.error, undefined, 'IPv4address errors')
252
- strictEqual(components.scheme, undefined, 'scheme')
253
- strictEqual(components.userinfo, undefined, 'userinfo')
254
- strictEqual(components.host, '::ffff:129.144.52.38', 'host')
255
- strictEqual(components.port, undefined, 'port')
256
- strictEqual(components.path, '', 'path')
257
- strictEqual(components.query, undefined, 'query')
258
- strictEqual(components.fragment, undefined, 'fragment')
217
+ t.equal(components.error, undefined, 'IPv4address errors')
218
+ t.equal(components.scheme, undefined, 'scheme')
219
+ t.equal(components.userinfo, undefined, 'userinfo')
220
+ t.equal(components.host, '::ffff:129.144.52.38', 'host')
221
+ t.equal(components.port, undefined, 'port')
222
+ t.equal(components.path, '', 'path')
223
+ t.equal(components.query, undefined, 'query')
224
+ t.equal(components.fragment, undefined, 'fragment')
259
225
 
260
226
  // mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4)
261
227
  components = URI.parse('uri://10.10.10.10.example.com/en/process')
262
- strictEqual(components.error, undefined, 'mixed errors')
263
- strictEqual(components.scheme, 'uri', 'scheme')
264
- strictEqual(components.userinfo, undefined, 'userinfo')
265
- strictEqual(components.host, '10.10.10.10.example.com', 'host')
266
- strictEqual(components.port, undefined, 'port')
267
- strictEqual(components.path, '/en/process', 'path')
268
- strictEqual(components.query, undefined, 'query')
269
- strictEqual(components.fragment, undefined, 'fragment')
228
+ t.equal(components.error, undefined, 'mixed errors')
229
+ t.equal(components.scheme, 'uri', 'scheme')
230
+ t.equal(components.userinfo, undefined, 'userinfo')
231
+ t.equal(components.host, '10.10.10.10.example.com', 'host')
232
+ t.equal(components.port, undefined, 'port')
233
+ t.equal(components.path, '/en/process', 'path')
234
+ t.equal(components.query, undefined, 'query')
235
+ t.equal(components.fragment, undefined, 'fragment')
270
236
 
271
237
  // IPv6address, example from bkw (https://github.com/garycourt/uri-js/pull/16)
272
238
  components = URI.parse('//[2606:2800:220:1:248:1893:25c8:1946]/test')
273
- strictEqual(components.error, undefined, 'IPv6address errors')
274
- strictEqual(components.scheme, undefined, 'scheme')
275
- strictEqual(components.userinfo, undefined, 'userinfo')
276
- strictEqual(components.host, '2606:2800:220:1:248:1893:25c8:1946', 'host')
277
- strictEqual(components.port, undefined, 'port')
278
- strictEqual(components.path, '/test', 'path')
279
- strictEqual(components.query, undefined, 'query')
280
- strictEqual(components.fragment, undefined, 'fragment')
239
+ t.equal(components.error, undefined, 'IPv6address errors')
240
+ t.equal(components.scheme, undefined, 'scheme')
241
+ t.equal(components.userinfo, undefined, 'userinfo')
242
+ t.equal(components.host, '2606:2800:220:1:248:1893:25c8:1946', 'host')
243
+ t.equal(components.port, undefined, 'port')
244
+ t.equal(components.path, '/test', 'path')
245
+ t.equal(components.query, undefined, 'query')
246
+ t.equal(components.fragment, undefined, 'fragment')
281
247
 
282
248
  // IPv6address, example from RFC 5952
283
249
  components = URI.parse('//[2001:db8::1]:80')
284
- strictEqual(components.error, undefined, 'IPv6address errors')
285
- strictEqual(components.scheme, undefined, 'scheme')
286
- strictEqual(components.userinfo, undefined, 'userinfo')
287
- strictEqual(components.host, '2001:db8::1', 'host')
288
- strictEqual(components.port, 80, 'port')
289
- strictEqual(components.path, '', 'path')
290
- strictEqual(components.query, undefined, 'query')
291
- strictEqual(components.fragment, undefined, 'fragment')
250
+ t.equal(components.error, undefined, 'IPv6address errors')
251
+ t.equal(components.scheme, undefined, 'scheme')
252
+ t.equal(components.userinfo, undefined, 'userinfo')
253
+ t.equal(components.host, '2001:db8::1', 'host')
254
+ t.equal(components.port, 80, 'port')
255
+ t.equal(components.path, '', 'path')
256
+ t.equal(components.query, undefined, 'query')
257
+ t.equal(components.fragment, undefined, 'fragment')
292
258
 
293
259
  // IPv6address with zone identifier, RFC 6874
294
260
  components = URI.parse('//[fe80::a%25en1]')
295
- strictEqual(components.error, undefined, 'IPv4address errors')
296
- strictEqual(components.scheme, undefined, 'scheme')
297
- strictEqual(components.userinfo, undefined, 'userinfo')
298
- strictEqual(components.host, 'fe80::a%en1', 'host')
299
- strictEqual(components.port, undefined, 'port')
300
- strictEqual(components.path, '', 'path')
301
- strictEqual(components.query, undefined, 'query')
302
- strictEqual(components.fragment, undefined, 'fragment')
261
+ t.equal(components.error, undefined, 'IPv4address errors')
262
+ t.equal(components.scheme, undefined, 'scheme')
263
+ t.equal(components.userinfo, undefined, 'userinfo')
264
+ t.equal(components.host, 'fe80::a%en1', 'host')
265
+ t.equal(components.port, undefined, 'port')
266
+ t.equal(components.path, '', 'path')
267
+ t.equal(components.query, undefined, 'query')
268
+ t.equal(components.fragment, undefined, 'fragment')
303
269
 
304
270
  // IPv6address with an unescaped interface specifier, example from pekkanikander (https://github.com/garycourt/uri-js/pull/22)
305
271
  components = URI.parse('//[2001:db8::7%en0]')
306
- strictEqual(components.error, undefined, 'IPv6address interface errors')
307
- strictEqual(components.scheme, undefined, 'scheme')
308
- strictEqual(components.userinfo, undefined, 'userinfo')
309
- strictEqual(components.host, '2001:db8::7%en0', 'host')
310
- strictEqual(components.port, undefined, 'port')
311
- strictEqual(components.path, '', 'path')
312
- strictEqual(components.query, undefined, 'query')
313
- strictEqual(components.fragment, undefined, 'fragment')
272
+ t.equal(components.error, undefined, 'IPv6address interface errors')
273
+ t.equal(components.scheme, undefined, 'scheme')
274
+ t.equal(components.userinfo, undefined, 'userinfo')
275
+ t.equal(components.host, '2001:db8::7%en0', 'host')
276
+ t.equal(components.port, undefined, 'port')
277
+ t.equal(components.path, '', 'path')
278
+ t.equal(components.query, undefined, 'query')
279
+ t.equal(components.fragment, undefined, 'fragment')
280
+
281
+ t.end()
314
282
  })
315
283
 
316
- test('URI Serialization', function () {
284
+ test('URI Serialization', (t) => {
317
285
  let components = {
318
286
  scheme: undefined,
319
287
  userinfo: undefined,
@@ -323,7 +291,7 @@ test('URI Serialization', function () {
323
291
  query: undefined,
324
292
  fragment: undefined
325
293
  }
326
- strictEqual(URI.serialize(components), '', 'Undefined Components')
294
+ t.equal(URI.serialize(components), '', 'Undefined Components')
327
295
 
328
296
  components = {
329
297
  scheme: '',
@@ -334,7 +302,7 @@ test('URI Serialization', function () {
334
302
  query: '',
335
303
  fragment: ''
336
304
  }
337
- strictEqual(URI.serialize(components), '//@:0?#', 'Empty Components')
305
+ t.equal(URI.serialize(components), '//@:0?#', 'Empty Components')
338
306
 
339
307
  components = {
340
308
  scheme: 'uri',
@@ -345,172 +313,177 @@ test('URI Serialization', function () {
345
313
  query: 'query',
346
314
  fragment: 'fragment'
347
315
  }
348
- strictEqual(URI.serialize(components), 'uri://foo:bar@example.com:1/path?query#fragment', 'All Components')
316
+ t.equal(URI.serialize(components), 'uri://foo:bar@example.com:1/path?query#fragment', 'All Components')
349
317
 
350
318
  components = {
351
319
  scheme: 'uri',
352
320
  host: 'example.com',
353
321
  port: '9000'
354
322
  }
355
- strictEqual(URI.serialize(components), 'uri://example.com:9000', 'String port')
323
+ t.equal(URI.serialize(components), 'uri://example.com:9000', 'String port')
356
324
 
357
- strictEqual(URI.serialize({ path: '//path' }), '/%2Fpath', 'Double slash path')
358
- strictEqual(URI.serialize({ path: 'foo:bar' }), 'foo%3Abar', 'Colon path')
359
- strictEqual(URI.serialize({ path: '?query' }), '%3Fquery', 'Query path')
325
+ t.equal(URI.serialize({ path: '//path' }), '/%2Fpath', 'Double slash path')
326
+ t.equal(URI.serialize({ path: 'foo:bar' }), 'foo%3Abar', 'Colon path')
327
+ t.equal(URI.serialize({ path: '?query' }), '%3Fquery', 'Query path')
360
328
 
361
329
  // mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4)
362
- strictEqual(URI.serialize({ host: '10.10.10.10.example.com' }), '//10.10.10.10.example.com', 'Mixed IPv4address & reg-name')
330
+ t.equal(URI.serialize({ host: '10.10.10.10.example.com' }), '//10.10.10.10.example.com', 'Mixed IPv4address & reg-name')
363
331
 
364
332
  // IPv6address
365
- strictEqual(URI.serialize({ host: '2001:db8::7' }), '//[2001:db8::7]', 'IPv6 Host')
366
- strictEqual(URI.serialize({ host: '::ffff:129.144.52.38' }), '//[::ffff:129.144.52.38]', 'IPv6 Mixed Host')
367
- strictEqual(URI.serialize({ host: '2606:2800:220:1:248:1893:25c8:1946' }), '//[2606:2800:220:1:248:1893:25c8:1946]', 'IPv6 Full Host')
333
+ t.equal(URI.serialize({ host: '2001:db8::7' }), '//[2001:db8::7]', 'IPv6 Host')
334
+ t.equal(URI.serialize({ host: '::ffff:129.144.52.38' }), '//[::ffff:129.144.52.38]', 'IPv6 Mixed Host')
335
+ t.equal(URI.serialize({ host: '2606:2800:220:1:248:1893:25c8:1946' }), '//[2606:2800:220:1:248:1893:25c8:1946]', 'IPv6 Full Host')
368
336
 
369
337
  // IPv6address with zone identifier, RFC 6874
370
- strictEqual(URI.serialize({ host: 'fe80::a%en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Unescaped Host')
371
- strictEqual(URI.serialize({ host: 'fe80::a%25en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Escaped Host')
338
+ t.equal(URI.serialize({ host: 'fe80::a%en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Unescaped Host')
339
+ t.equal(URI.serialize({ host: 'fe80::a%25en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Escaped Host')
340
+
341
+ t.end()
372
342
  })
373
343
 
374
- test('URI Resolving', { skip: true }, function () {
344
+ test('URI Resolving', { skip: true }, (t) => {
375
345
  // normal examples from RFC 3986
376
346
  const base = 'uri://a/b/c/d;p?q'
377
- strictEqual(URI.resolve(base, 'g:h'), 'g:h', 'g:h')
378
- strictEqual(URI.resolve(base, 'g:h'), 'g:h', 'g:h')
379
- strictEqual(URI.resolve(base, 'g'), 'uri://a/b/c/g', 'g')
380
- strictEqual(URI.resolve(base, './g'), 'uri://a/b/c/g', './g')
381
- strictEqual(URI.resolve(base, 'g/'), 'uri://a/b/c/g/', 'g/')
382
- strictEqual(URI.resolve(base, '/g'), 'uri://a/g', '/g')
383
- strictEqual(URI.resolve(base, '//g'), 'uri://g', '//g')
384
- strictEqual(URI.resolve(base, '?y'), 'uri://a/b/c/d;p?y', '?y')
385
- strictEqual(URI.resolve(base, 'g?y'), 'uri://a/b/c/g?y', 'g?y')
386
- strictEqual(URI.resolve(base, '#s'), 'uri://a/b/c/d;p?q#s', '#s')
387
- strictEqual(URI.resolve(base, 'g#s'), 'uri://a/b/c/g#s', 'g#s')
388
- strictEqual(URI.resolve(base, 'g?y#s'), 'uri://a/b/c/g?y#s', 'g?y#s')
389
- strictEqual(URI.resolve(base, ';x'), 'uri://a/b/c/;x', ';x')
390
- strictEqual(URI.resolve(base, 'g;x'), 'uri://a/b/c/g;x', 'g;x')
391
- strictEqual(URI.resolve(base, 'g;x?y#s'), 'uri://a/b/c/g;x?y#s', 'g;x?y#s')
392
- strictEqual(URI.resolve(base, ''), 'uri://a/b/c/d;p?q', '')
393
- strictEqual(URI.resolve(base, '.'), 'uri://a/b/c/', '.')
394
- strictEqual(URI.resolve(base, './'), 'uri://a/b/c/', './')
395
- strictEqual(URI.resolve(base, '..'), 'uri://a/b/', '..')
396
- strictEqual(URI.resolve(base, '../'), 'uri://a/b/', '../')
397
- strictEqual(URI.resolve(base, '../g'), 'uri://a/b/g', '../g')
398
- strictEqual(URI.resolve(base, '../..'), 'uri://a/', '../..')
399
- strictEqual(URI.resolve(base, '../../'), 'uri://a/', '../../')
400
- strictEqual(URI.resolve(base, '../../g'), 'uri://a/g', '../../g')
347
+ t.equal(URI.resolve(base, 'g:h'), 'g:h', 'g:h')
348
+ t.equal(URI.resolve(base, 'g'), 'uri://a/b/c/g', 'g')
349
+ t.equal(URI.resolve(base, './g'), 'uri://a/b/c/g', './g')
350
+ t.equal(URI.resolve(base, 'g/'), 'uri://a/b/c/g/', 'g/')
351
+ t.equal(URI.resolve(base, '/g'), 'uri://a/g', '/g')
352
+ t.equal(URI.resolve(base, '//g'), 'uri://g', '//g')
353
+ t.equal(URI.resolve(base, '?y'), 'uri://a/b/c/d;p?y', '?y')
354
+ t.equal(URI.resolve(base, 'g?y'), 'uri://a/b/c/g?y', 'g?y')
355
+ t.equal(URI.resolve(base, '#s'), 'uri://a/b/c/d;p?q#s', '#s')
356
+ t.equal(URI.resolve(base, 'g#s'), 'uri://a/b/c/g#s', 'g#s')
357
+ t.equal(URI.resolve(base, 'g?y#s'), 'uri://a/b/c/g?y#s', 'g?y#s')
358
+ t.equal(URI.resolve(base, ';x'), 'uri://a/b/c/;x', ';x')
359
+ t.equal(URI.resolve(base, 'g;x'), 'uri://a/b/c/g;x', 'g;x')
360
+ t.equal(URI.resolve(base, 'g;x?y#s'), 'uri://a/b/c/g;x?y#s', 'g;x?y#s')
361
+ t.equal(URI.resolve(base, ''), 'uri://a/b/c/d;p?q', '')
362
+ t.equal(URI.resolve(base, '.'), 'uri://a/b/c/', '.')
363
+ t.equal(URI.resolve(base, './'), 'uri://a/b/c/', './')
364
+ t.equal(URI.resolve(base, '..'), 'uri://a/b/', '..')
365
+ t.equal(URI.resolve(base, '../'), 'uri://a/b/', '../')
366
+ t.equal(URI.resolve(base, '../g'), 'uri://a/b/g', '../g')
367
+ t.equal(URI.resolve(base, '../..'), 'uri://a/', '../..')
368
+ t.equal(URI.resolve(base, '../../'), 'uri://a/', '../../')
369
+ t.equal(URI.resolve(base, '../../g'), 'uri://a/g', '../../g')
401
370
 
402
371
  // abnormal examples from RFC 3986
403
- strictEqual(URI.resolve(base, '../../../g'), 'uri://a/g', '../../../g')
404
- strictEqual(URI.resolve(base, '../../../../g'), 'uri://a/g', '../../../../g')
405
-
406
- strictEqual(URI.resolve(base, '/./g'), 'uri://a/g', '/./g')
407
- strictEqual(URI.resolve(base, '/../g'), 'uri://a/g', '/../g')
408
- strictEqual(URI.resolve(base, 'g.'), 'uri://a/b/c/g.', 'g.')
409
- strictEqual(URI.resolve(base, '.g'), 'uri://a/b/c/.g', '.g')
410
- strictEqual(URI.resolve(base, 'g..'), 'uri://a/b/c/g..', 'g..')
411
- strictEqual(URI.resolve(base, '..g'), 'uri://a/b/c/..g', '..g')
412
-
413
- strictEqual(URI.resolve(base, './../g'), 'uri://a/b/g', './../g')
414
- strictEqual(URI.resolve(base, './g/.'), 'uri://a/b/c/g/', './g/.')
415
- strictEqual(URI.resolve(base, 'g/./h'), 'uri://a/b/c/g/h', 'g/./h')
416
- strictEqual(URI.resolve(base, 'g/../h'), 'uri://a/b/c/h', 'g/../h')
417
- strictEqual(URI.resolve(base, 'g;x=1/./y'), 'uri://a/b/c/g;x=1/y', 'g;x=1/./y')
418
- strictEqual(URI.resolve(base, 'g;x=1/../y'), 'uri://a/b/c/y', 'g;x=1/../y')
419
-
420
- strictEqual(URI.resolve(base, 'g?y/./x'), 'uri://a/b/c/g?y/./x', 'g?y/./x')
421
- strictEqual(URI.resolve(base, 'g?y/../x'), 'uri://a/b/c/g?y/../x', 'g?y/../x')
422
- strictEqual(URI.resolve(base, 'g#s/./x'), 'uri://a/b/c/g#s/./x', 'g#s/./x')
423
- strictEqual(URI.resolve(base, 'g#s/../x'), 'uri://a/b/c/g#s/../x', 'g#s/../x')
424
-
425
- strictEqual(URI.resolve(base, 'uri:g'), 'uri:g', 'uri:g')
426
- strictEqual(URI.resolve(base, 'uri:g', { tolerant: true }), 'uri://a/b/c/g', 'uri:g')
372
+ t.equal(URI.resolve(base, '../../../g'), 'uri://a/g', '../../../g')
373
+ t.equal(URI.resolve(base, '../../../../g'), 'uri://a/g', '../../../../g')
374
+
375
+ t.equal(URI.resolve(base, '/./g'), 'uri://a/g', '/./g')
376
+ t.equal(URI.resolve(base, '/../g'), 'uri://a/g', '/../g')
377
+ t.equal(URI.resolve(base, 'g.'), 'uri://a/b/c/g.', 'g.')
378
+ t.equal(URI.resolve(base, '.g'), 'uri://a/b/c/.g', '.g')
379
+ t.equal(URI.resolve(base, 'g..'), 'uri://a/b/c/g..', 'g..')
380
+ t.equal(URI.resolve(base, '..g'), 'uri://a/b/c/..g', '..g')
381
+
382
+ t.equal(URI.resolve(base, './../g'), 'uri://a/b/g', './../g')
383
+ t.equal(URI.resolve(base, './g/.'), 'uri://a/b/c/g/', './g/.')
384
+ t.equal(URI.resolve(base, 'g/./h'), 'uri://a/b/c/g/h', 'g/./h')
385
+ t.equal(URI.resolve(base, 'g/../h'), 'uri://a/b/c/h', 'g/../h')
386
+ t.equal(URI.resolve(base, 'g;x=1/./y'), 'uri://a/b/c/g;x=1/y', 'g;x=1/./y')
387
+ t.equal(URI.resolve(base, 'g;x=1/../y'), 'uri://a/b/c/y', 'g;x=1/../y')
388
+
389
+ t.equal(URI.resolve(base, 'g?y/./x'), 'uri://a/b/c/g?y/./x', 'g?y/./x')
390
+ t.equal(URI.resolve(base, 'g?y/../x'), 'uri://a/b/c/g?y/../x', 'g?y/../x')
391
+ t.equal(URI.resolve(base, 'g#s/./x'), 'uri://a/b/c/g#s/./x', 'g#s/./x')
392
+ t.equal(URI.resolve(base, 'g#s/../x'), 'uri://a/b/c/g#s/../x', 'g#s/../x')
393
+
394
+ t.equal(URI.resolve(base, 'uri:g'), 'uri:g', 'uri:g')
395
+ t.equal(URI.resolve(base, 'uri:g', { tolerant: true }), 'uri://a/b/c/g', 'uri:g')
427
396
 
428
397
  // examples by PAEz
429
- strictEqual(URI.resolve('//www.g.com/', '/adf\ngf'), '//www.g.com/adf%0Agf', '/adf\\ngf')
430
- strictEqual(URI.resolve('//www.g.com/error\n/bleh/bleh', '..'), '//www.g.com/error%0A/', '//www.g.com/error\\n/bleh/bleh')
398
+ t.equal(URI.resolve('//www.g.com/', '/adf\ngf'), '//www.g.com/adf%0Agf', '/adf\\ngf')
399
+ t.equal(URI.resolve('//www.g.com/error\n/bleh/bleh', '..'), '//www.g.com/error%0A/', '//www.g.com/error\\n/bleh/bleh')
400
+
401
+ t.end()
431
402
  })
432
403
 
433
- test('URI Normalizing', { skip: true }, function () {
404
+ test('URI Normalizing', { skip: true }, (t) => {
434
405
  // test from RFC 3987
435
- strictEqual(URI.normalize('uri://www.example.org/red%09ros\xE9#red'), 'uri://www.example.org/red%09ros%C3%A9#red')
406
+ t.equal(URI.normalize('uri://www.example.org/red%09ros\xE9#red'), 'uri://www.example.org/red%09ros%C3%A9#red')
436
407
 
437
408
  // IPv4address
438
- strictEqual(URI.normalize('//192.068.001.000'), '//192.68.1.0')
409
+ t.equal(URI.normalize('//192.068.001.000'), '//192.68.1.0')
439
410
 
440
411
  // IPv6address, example from RFC 3513
441
- strictEqual(URI.normalize('http://[1080::8:800:200C:417A]/'), 'http://[1080::8:800:200c:417a]/')
412
+ t.equal(URI.normalize('http://[1080::8:800:200C:417A]/'), 'http://[1080::8:800:200c:417a]/')
442
413
 
443
414
  // IPv6address, examples from RFC 5952
444
- strictEqual(URI.normalize('//[2001:0db8::0001]/'), '//[2001:db8::1]/')
445
- strictEqual(URI.normalize('//[2001:db8::1:0000:1]/'), '//[2001:db8::1:0:1]/')
446
- strictEqual(URI.normalize('//[2001:db8:0:0:0:0:2:1]/'), '//[2001:db8::2:1]/')
447
- strictEqual(URI.normalize('//[2001:db8:0:1:1:1:1:1]/'), '//[2001:db8:0:1:1:1:1:1]/')
448
- strictEqual(URI.normalize('//[2001:0:0:1:0:0:0:1]/'), '//[2001:0:0:1::1]/')
449
- strictEqual(URI.normalize('//[2001:db8:0:0:1:0:0:1]/'), '//[2001:db8::1:0:0:1]/')
450
- strictEqual(URI.normalize('//[2001:DB8::1]/'), '//[2001:db8::1]/')
451
- strictEqual(URI.normalize('//[0:0:0:0:0:ffff:192.0.2.1]/'), '//[::ffff:192.0.2.1]/')
415
+ t.equal(URI.normalize('//[2001:0db8::0001]/'), '//[2001:db8::1]/')
416
+ t.equal(URI.normalize('//[2001:db8::1:0000:1]/'), '//[2001:db8::1:0:1]/')
417
+ t.equal(URI.normalize('//[2001:db8:0:0:0:0:2:1]/'), '//[2001:db8::2:1]/')
418
+ t.equal(URI.normalize('//[2001:db8:0:1:1:1:1:1]/'), '//[2001:db8:0:1:1:1:1:1]/')
419
+ t.equal(URI.normalize('//[2001:0:0:1:0:0:0:1]/'), '//[2001:0:0:1::1]/')
420
+ t.equal(URI.normalize('//[2001:db8:0:0:1:0:0:1]/'), '//[2001:db8::1:0:0:1]/')
421
+ t.equal(URI.normalize('//[2001:DB8::1]/'), '//[2001:db8::1]/')
422
+ t.equal(URI.normalize('//[0:0:0:0:0:ffff:192.0.2.1]/'), '//[::ffff:192.0.2.1]/')
452
423
 
453
424
  // Mixed IPv4 and IPv6 address
454
- strictEqual(URI.normalize('//[1:2:3:4:5:6:192.0.2.1]/'), '//[1:2:3:4:5:6:192.0.2.1]/')
455
- strictEqual(URI.normalize('//[1:2:3:4:5:6:192.068.001.000]/'), '//[1:2:3:4:5:6:192.68.1.0]/')
425
+ t.equal(URI.normalize('//[1:2:3:4:5:6:192.0.2.1]/'), '//[1:2:3:4:5:6:192.0.2.1]/')
426
+ t.equal(URI.normalize('//[1:2:3:4:5:6:192.068.001.000]/'), '//[1:2:3:4:5:6:192.68.1.0]/')
427
+
428
+ t.end()
456
429
  })
457
430
 
458
- test('URI Equals', function () {
431
+ test('URI Equals', (t) => {
459
432
  // test from RFC 3986
460
- strictEqual(URI.equal('example://a/b/c/%7Bfoo%7D', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d'), true)
433
+ t.equal(URI.equal('example://a/b/c/%7Bfoo%7D', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d'), true)
461
434
 
462
435
  // test from RFC 3987
463
- strictEqual(URI.equal('http://example.org/~user', 'http://example.org/%7euser'), true)
436
+ t.equal(URI.equal('http://example.org/~user', 'http://example.org/%7euser'), true)
437
+
438
+ t.end()
464
439
  })
465
440
 
466
- test('Escape Component', { skip: true }, function () {
441
+ test('Escape Component', { skip: true }, (t) => {
467
442
  let chr
468
443
  for (let d = 0; d <= 129; ++d) {
469
444
  chr = String.fromCharCode(d)
470
445
  if (!chr.match(/[$&+,;=]/)) {
471
- strictEqual(URI.escapeComponent(chr), encodeURIComponent(chr))
446
+ t.equal(URI.escapeComponent(chr), encodeURIComponent(chr))
472
447
  } else {
473
- strictEqual(URI.escapeComponent(chr), chr)
448
+ t.equal(URI.escapeComponent(chr), chr)
474
449
  }
475
450
  }
476
- strictEqual(URI.escapeComponent('\u00c0'), encodeURIComponent('\u00c0'))
477
- strictEqual(URI.escapeComponent('\u07ff'), encodeURIComponent('\u07ff'))
478
- strictEqual(URI.escapeComponent('\u0800'), encodeURIComponent('\u0800'))
479
- strictEqual(URI.escapeComponent('\u30a2'), encodeURIComponent('\u30a2'))
451
+ t.equal(URI.escapeComponent('\u00c0'), encodeURIComponent('\u00c0'))
452
+ t.equal(URI.escapeComponent('\u07ff'), encodeURIComponent('\u07ff'))
453
+ t.equal(URI.escapeComponent('\u0800'), encodeURIComponent('\u0800'))
454
+ t.equal(URI.escapeComponent('\u30a2'), encodeURIComponent('\u30a2'))
455
+ t.end()
480
456
  })
481
457
 
482
- test('Unescape Component', { skip: true }, function () {
458
+ test('Unescape Component', { skip: true }, (t) => {
483
459
  let chr
484
460
  for (let d = 0; d <= 129; ++d) {
485
461
  chr = String.fromCharCode(d)
486
- strictEqual(URI.unescapeComponent(encodeURIComponent(chr)), chr)
462
+ t.equal(URI.unescapeComponent(encodeURIComponent(chr)), chr)
487
463
  }
488
- strictEqual(URI.unescapeComponent(encodeURIComponent('\u00c0')), '\u00c0')
489
- strictEqual(URI.unescapeComponent(encodeURIComponent('\u07ff')), '\u07ff')
490
- strictEqual(URI.unescapeComponent(encodeURIComponent('\u0800')), '\u0800')
491
- strictEqual(URI.unescapeComponent(encodeURIComponent('\u30a2')), '\u30a2')
464
+ t.equal(URI.unescapeComponent(encodeURIComponent('\u00c0')), '\u00c0')
465
+ t.equal(URI.unescapeComponent(encodeURIComponent('\u07ff')), '\u07ff')
466
+ t.equal(URI.unescapeComponent(encodeURIComponent('\u0800')), '\u0800')
467
+ t.equal(URI.unescapeComponent(encodeURIComponent('\u30a2')), '\u30a2')
468
+ t.end()
492
469
  })
493
470
 
494
- //
495
- // IRI
496
- //
497
-
498
471
  const IRI_OPTION = { iri: true, unicodeSupport: true }
499
472
 
500
- test('IRI Parsing', { skip: true }, function () {
473
+ test('IRI Parsing', { skip: true }, (t) => {
501
474
  const components = URI.parse('uri://us\xA0er:pa\uD7FFss@example.com:123/o\uF900ne/t\uFDCFwo.t\uFDF0hree?q1=a1\uF8FF\uE000&q2=a2#bo\uFFEFdy', IRI_OPTION)
502
- strictEqual(components.error, undefined, 'all errors')
503
- strictEqual(components.scheme, 'uri', 'scheme')
504
- // strictEqual(components.authority, "us\xA0er:pa\uD7FFss@example.com:123", "authority");
505
- strictEqual(components.userinfo, 'us\xA0er:pa\uD7FFss', 'userinfo')
506
- strictEqual(components.host, 'example.com', 'host')
507
- strictEqual(components.port, 123, 'port')
508
- strictEqual(components.path, '/o\uF900ne/t\uFDCFwo.t\uFDF0hree', 'path')
509
- strictEqual(components.query, 'q1=a1\uF8FF\uE000&q2=a2', 'query')
510
- strictEqual(components.fragment, 'bo\uFFEFdy', 'fragment')
475
+ t.equal(components.error, undefined, 'all errors')
476
+ t.equal(components.scheme, 'uri', 'scheme')
477
+ t.equal(components.userinfo, 'us\xA0er:pa\uD7FFss', 'userinfo')
478
+ t.equal(components.host, 'example.com', 'host')
479
+ t.equal(components.port, 123, 'port')
480
+ t.equal(components.path, '/o\uF900ne/t\uFDCFwo.t\uFDF0hree', 'path')
481
+ t.equal(components.query, 'q1=a1\uF8FF\uE000&q2=a2', 'query')
482
+ t.equal(components.fragment, 'bo\uFFEFdy', 'fragment')
483
+ t.end()
511
484
  })
512
485
 
513
- test('IRI Serialization', { skip: true }, function () {
486
+ test('IRI Serialization', { skip: true }, (t) => {
514
487
  const components = {
515
488
  scheme: 'uri',
516
489
  userinfo: 'us\xA0er:pa\uD7FFss',
@@ -520,421 +493,420 @@ test('IRI Serialization', { skip: true }, function () {
520
493
  query: 'q1=a1\uF8FF\uE000&q2=a2',
521
494
  fragment: 'bo\uFFEFdy\uE001'
522
495
  }
523
- strictEqual(URI.serialize(components, IRI_OPTION), 'uri://us\xA0er:pa\uD7FFss@example.com:123/o\uF900ne/t\uFDCFwo.t\uFDF0hree?q1=a1\uF8FF\uE000&q2=a2#bo\uFFEFdy%EE%80%81')
496
+ t.equal(URI.serialize(components, IRI_OPTION), 'uri://us\xA0er:pa\uD7FFss@example.com:123/o\uF900ne/t\uFDCFwo.t\uFDF0hree?q1=a1\uF8FF\uE000&q2=a2#bo\uFFEFdy%EE%80%81')
497
+ t.end()
524
498
  })
525
499
 
526
- test('IRI Normalizing', { skip: true }, function () {
527
- strictEqual(URI.normalize('uri://www.example.org/red%09ros\xE9#red', IRI_OPTION), 'uri://www.example.org/red%09ros\xE9#red')
500
+ test('IRI Normalizing', { skip: true }, (t) => {
501
+ t.equal(URI.normalize('uri://www.example.org/red%09ros\xE9#red', IRI_OPTION), 'uri://www.example.org/red%09ros\xE9#red')
502
+ t.end()
528
503
  })
529
504
 
530
- test('IRI Equals', { skip: true }, function () {
505
+ test('IRI Equals', { skip: true }, (t) => {
531
506
  // example from RFC 3987
532
- strictEqual(URI.equal('example://a/b/c/%7Bfoo%7D/ros\xE9', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d/ros%C3%A9', IRI_OPTION), true)
507
+ t.equal(URI.equal('example://a/b/c/%7Bfoo%7D/ros\xE9', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d/ros%C3%A9', IRI_OPTION), true)
508
+ t.end()
533
509
  })
534
510
 
535
- test('Convert IRI to URI', { skip: true }, function () {
511
+ test('Convert IRI to URI', { skip: true }, (t) => {
536
512
  // example from RFC 3987
537
- strictEqual(URI.serialize(URI.parse('uri://www.example.org/red%09ros\xE9#red', IRI_OPTION)), 'uri://www.example.org/red%09ros%C3%A9#red')
513
+ t.equal(URI.serialize(URI.parse('uri://www.example.org/red%09ros\xE9#red', IRI_OPTION)), 'uri://www.example.org/red%09ros%C3%A9#red')
538
514
 
539
515
  // Internationalized Domain Name conversion via punycode example from RFC 3987
540
- strictEqual(URI.serialize(URI.parse('uri://r\xE9sum\xE9.example.org', { iri: true, domainHost: true }), { domainHost: true }), 'uri://xn--rsum-bpad.example.org')
516
+ t.equal(URI.serialize(URI.parse('uri://r\xE9sum\xE9.example.org', { iri: true, domainHost: true }), { domainHost: true }), 'uri://xn--rsum-bpad.example.org')
517
+ t.end()
541
518
  })
542
519
 
543
- test('Convert URI to IRI', { skip: true }, function () {
520
+ test('Convert URI to IRI', { skip: true }, (t) => {
544
521
  // examples from RFC 3987
545
- strictEqual(URI.serialize(URI.parse('uri://www.example.org/D%C3%BCrst'), IRI_OPTION), 'uri://www.example.org/D\xFCrst')
546
- strictEqual(URI.serialize(URI.parse('uri://www.example.org/D%FCrst'), IRI_OPTION), 'uri://www.example.org/D%FCrst')
547
- strictEqual(URI.serialize(URI.parse('uri://xn--99zt52a.example.org/%e2%80%ae'), IRI_OPTION), 'uri://xn--99zt52a.example.org/%E2%80%AE') // or uri://\u7D0D\u8C46.example.org/%E2%80%AE
522
+ t.equal(URI.serialize(URI.parse('uri://www.example.org/D%C3%BCrst'), IRI_OPTION), 'uri://www.example.org/D\xFCrst')
523
+ t.equal(URI.serialize(URI.parse('uri://www.example.org/D%FCrst'), IRI_OPTION), 'uri://www.example.org/D%FCrst')
524
+ t.equal(URI.serialize(URI.parse('uri://xn--99zt52a.example.org/%e2%80%ae'), IRI_OPTION), 'uri://xn--99zt52a.example.org/%E2%80%AE') // or uri://\u7D0D\u8C46.example.org/%E2%80%AE
548
525
 
549
526
  // Internationalized Domain Name conversion via punycode example from RFC 3987
550
- strictEqual(URI.serialize(URI.parse('uri://xn--rsum-bpad.example.org', { domainHost: true }), { iri: true, domainHost: true }), 'uri://r\xE9sum\xE9.example.org')
527
+ t.equal(URI.serialize(URI.parse('uri://xn--rsum-bpad.example.org', { domainHost: true }), { iri: true, domainHost: true }), 'uri://r\xE9sum\xE9.example.org')
528
+ t.end()
551
529
  })
552
530
 
553
- //
554
- // HTTP
555
- //
556
-
557
531
  if (URI.SCHEMES.http) {
558
- // module("HTTP");
559
-
560
- test('HTTP Equals', function () {
532
+ test('HTTP Equals', (t) => {
561
533
  // test from RFC 2616
562
- strictEqual(URI.equal('http://abc.com:80/~smith/home.html', 'http://abc.com/~smith/home.html'), true)
563
- strictEqual(URI.equal('http://ABC.com/%7Esmith/home.html', 'http://abc.com/~smith/home.html'), true)
564
- strictEqual(URI.equal('http://ABC.com:/%7esmith/home.html', 'http://abc.com/~smith/home.html'), true)
565
- strictEqual(URI.equal('HTTP://ABC.COM', 'http://abc.com/'), true)
534
+ t.equal(URI.equal('http://abc.com:80/~smith/home.html', 'http://abc.com/~smith/home.html'), true)
535
+ t.equal(URI.equal('http://ABC.com/%7Esmith/home.html', 'http://abc.com/~smith/home.html'), true)
536
+ t.equal(URI.equal('http://ABC.com:/%7esmith/home.html', 'http://abc.com/~smith/home.html'), true)
537
+ t.equal(URI.equal('HTTP://ABC.COM', 'http://abc.com/'), true)
566
538
  // test from RFC 3986
567
- strictEqual(URI.equal('http://example.com:/', 'http://example.com:80/'), true)
539
+ t.equal(URI.equal('http://example.com:/', 'http://example.com:80/'), true)
540
+ t.end()
568
541
  })
569
542
  }
570
543
 
571
544
  if (URI.SCHEMES.https) {
572
- // module("HTTPS");
573
-
574
- test('HTTPS Equals', function () {
575
- strictEqual(URI.equal('https://example.com', 'https://example.com:443/'), true)
576
- strictEqual(URI.equal('https://example.com:/', 'https://example.com:443/'), true)
545
+ test('HTTPS Equals', (t) => {
546
+ t.equal(URI.equal('https://example.com', 'https://example.com:443/'), true)
547
+ t.equal(URI.equal('https://example.com:/', 'https://example.com:443/'), true)
548
+ t.end()
577
549
  })
578
550
  }
579
551
 
580
- //
581
- // URN
582
- //
583
-
584
552
  if (URI.SCHEMES.urn) {
585
- // module("URN");
586
-
587
- test('URN Parsing', function () {
553
+ test('URN Parsing', (t) => {
588
554
  // example from RFC 2141
589
555
  const components = URI.parse('urn:foo:a123,456')
590
- strictEqual(components.error, undefined, 'errors')
591
- strictEqual(components.scheme, 'urn', 'scheme')
592
- // strictEqual(components.authority, undefined, "authority");
593
- strictEqual(components.userinfo, undefined, 'userinfo')
594
- strictEqual(components.host, undefined, 'host')
595
- strictEqual(components.port, undefined, 'port')
596
- strictEqual(components.path, undefined, 'path')
597
- strictEqual(components.query, undefined, 'query')
598
- strictEqual(components.fragment, undefined, 'fragment')
599
- strictEqual(components.nid, 'foo', 'nid')
600
- strictEqual(components.nss, 'a123,456', 'nss')
556
+ t.equal(components.error, undefined, 'errors')
557
+ t.equal(components.scheme, 'urn', 'scheme')
558
+ t.equal(components.userinfo, undefined, 'userinfo')
559
+ t.equal(components.host, undefined, 'host')
560
+ t.equal(components.port, undefined, 'port')
561
+ t.equal(components.path, undefined, 'path')
562
+ t.equal(components.query, undefined, 'query')
563
+ t.equal(components.fragment, undefined, 'fragment')
564
+ t.equal(components.nid, 'foo', 'nid')
565
+ t.equal(components.nss, 'a123,456', 'nss')
566
+ t.end()
601
567
  })
602
568
 
603
- test('URN Serialization', function () {
569
+ test('URN Serialization', (t) => {
604
570
  // example from RFC 2141
605
571
  const components = {
606
572
  scheme: 'urn',
607
573
  nid: 'foo',
608
574
  nss: 'a123,456'
609
575
  }
610
- strictEqual(URI.serialize(components), 'urn:foo:a123,456')
576
+ t.equal(URI.serialize(components), 'urn:foo:a123,456')
577
+ t.end()
611
578
  })
612
579
 
613
- test('URN Equals', { skip: true }, function () {
580
+ test('URN Equals', { skip: true }, (t) => {
614
581
  // test from RFC 2141
615
- strictEqual(URI.equal('urn:foo:a123,456', 'urn:foo:a123,456'), true)
616
- strictEqual(URI.equal('urn:foo:a123,456', 'URN:foo:a123,456'), true)
617
- strictEqual(URI.equal('urn:foo:a123,456', 'urn:FOO:a123,456'), true)
618
- strictEqual(URI.equal('urn:foo:a123,456', 'urn:foo:A123,456'), false)
619
- strictEqual(URI.equal('urn:foo:a123%2C456', 'URN:FOO:a123%2c456'), true)
582
+ t.equal(URI.equal('urn:foo:a123,456', 'urn:foo:a123,456'), true)
583
+ t.equal(URI.equal('urn:foo:a123,456', 'URN:foo:a123,456'), true)
584
+ t.equal(URI.equal('urn:foo:a123,456', 'urn:FOO:a123,456'), true)
585
+ t.equal(URI.equal('urn:foo:a123,456', 'urn:foo:A123,456'), false)
586
+ t.equal(URI.equal('urn:foo:a123%2C456', 'URN:FOO:a123%2c456'), true)
587
+ t.end()
620
588
  })
621
589
 
622
- test('URN Resolving', function () {
590
+ test('URN Resolving', (t) => {
623
591
  // example from epoberezkin
624
- strictEqual(URI.resolve('', 'urn:some:ip:prop'), 'urn:some:ip:prop')
625
- strictEqual(URI.resolve('#', 'urn:some:ip:prop'), 'urn:some:ip:prop')
626
- strictEqual(URI.resolve('urn:some:ip:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop')
627
- strictEqual(URI.resolve('urn:some:other:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop')
592
+ t.equal(URI.resolve('', 'urn:some:ip:prop'), 'urn:some:ip:prop')
593
+ t.equal(URI.resolve('#', 'urn:some:ip:prop'), 'urn:some:ip:prop')
594
+ t.equal(URI.resolve('urn:some:ip:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop')
595
+ t.equal(URI.resolve('urn:some:other:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop')
596
+ t.end()
628
597
  })
629
598
 
630
- //
631
- // URN UUID
632
- //
633
-
634
- test('UUID Parsing', function () {
599
+ test('UUID Parsing', (t) => {
635
600
  // example from RFC 4122
636
601
  let components = URI.parse('urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
637
- strictEqual(components.error, undefined, 'errors')
638
- strictEqual(components.scheme, 'urn', 'scheme')
639
- // strictEqual(components.authority, undefined, "authority");
640
- strictEqual(components.userinfo, undefined, 'userinfo')
641
- strictEqual(components.host, undefined, 'host')
642
- strictEqual(components.port, undefined, 'port')
643
- strictEqual(components.path, undefined, 'path')
644
- strictEqual(components.query, undefined, 'query')
645
- strictEqual(components.fragment, undefined, 'fragment')
646
- strictEqual(components.nid, 'uuid', 'nid')
647
- strictEqual(components.nss, undefined, 'nss')
648
- strictEqual(components.uuid, 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', 'uuid')
602
+ t.equal(components.error, undefined, 'errors')
603
+ t.equal(components.scheme, 'urn', 'scheme')
604
+ t.equal(components.userinfo, undefined, 'userinfo')
605
+ t.equal(components.host, undefined, 'host')
606
+ t.equal(components.port, undefined, 'port')
607
+ t.equal(components.path, undefined, 'path')
608
+ t.equal(components.query, undefined, 'query')
609
+ t.equal(components.fragment, undefined, 'fragment')
610
+ t.equal(components.nid, 'uuid', 'nid')
611
+ t.equal(components.nss, undefined, 'nss')
612
+ t.equal(components.uuid, 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', 'uuid')
649
613
 
650
614
  components = URI.parse('urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
651
- notStrictEqual(components.error, undefined, 'errors')
615
+ t.notEqual(components.error, undefined, 'errors')
616
+ t.end()
652
617
  })
653
618
 
654
- test('UUID Serialization', function () {
619
+ test('UUID Serialization', (t) => {
655
620
  // example from RFC 4122
656
621
  let components = {
657
622
  scheme: 'urn',
658
623
  nid: 'uuid',
659
624
  uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
660
625
  }
661
- strictEqual(URI.serialize(components), 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
626
+ t.equal(URI.serialize(components), 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
662
627
 
663
628
  components = {
664
629
  scheme: 'urn',
665
630
  nid: 'uuid',
666
631
  uuid: 'notauuid-7dec-11d0-a765-00a0c91e6bf6'
667
632
  }
668
- strictEqual(URI.serialize(components), 'urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
633
+ t.equal(URI.serialize(components), 'urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
634
+ t.end()
669
635
  })
670
636
 
671
- test('UUID Equals', function () {
672
- strictEqual(URI.equal('URN:UUID:F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6', 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6'), true)
637
+ test('UUID Equals', (t) => {
638
+ t.equal(URI.equal('URN:UUID:F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6', 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6'), true)
639
+ t.end()
673
640
  })
674
641
 
675
- test('URN NID Override', function () {
642
+ test('URN NID Override', (t) => {
676
643
  let components = URI.parse('urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6', { nid: 'uuid' })
677
- strictEqual(components.error, undefined, 'errors')
678
- strictEqual(components.scheme, 'urn', 'scheme')
679
- strictEqual(components.path, undefined, 'path')
680
- strictEqual(components.nid, 'foo', 'nid')
681
- strictEqual(components.nss, undefined, 'nss')
682
- strictEqual(components.uuid, 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', 'uuid')
644
+ t.equal(components.error, undefined, 'errors')
645
+ t.equal(components.scheme, 'urn', 'scheme')
646
+ t.equal(components.path, undefined, 'path')
647
+ t.equal(components.nid, 'foo', 'nid')
648
+ t.equal(components.nss, undefined, 'nss')
649
+ t.equal(components.uuid, 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', 'uuid')
683
650
 
684
651
  components = {
685
652
  scheme: 'urn',
686
653
  nid: 'foo',
687
654
  uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
688
655
  }
689
- strictEqual(URI.serialize(components, { nid: 'uuid' }), 'urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
656
+ t.equal(URI.serialize(components, { nid: 'uuid' }), 'urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
657
+ t.end()
690
658
  })
691
659
  }
692
660
 
693
- //
694
- // Mailto
695
- //
696
-
697
661
  if (URI.SCHEMES.mailto) {
698
- // module("Mailto");
699
-
700
- test('Mailto Parse', function () {
662
+ test('Mailto Parse', (t) => {
701
663
  let components
702
664
 
703
665
  // tests from RFC 6068
704
666
 
705
667
  components = URI.parse('mailto:chris@example.com')
706
- strictEqual(components.error, undefined, 'error')
707
- strictEqual(components.scheme, 'mailto', 'scheme')
708
- strictEqual(components.userinfo, undefined, 'userinfo')
709
- strictEqual(components.host, undefined, 'host')
710
- strictEqual(components.port, undefined, 'port')
711
- strictEqual(components.path, undefined, 'path')
712
- strictEqual(components.query, undefined, 'query')
713
- strictEqual(components.fragment, undefined, 'fragment')
714
- deepEqual(components.to, ['chris@example.com'], 'to')
715
- strictEqual(components.subject, undefined, 'subject')
716
- strictEqual(components.body, undefined, 'body')
717
- strictEqual(components.headers, undefined, 'headers')
668
+ t.equal(components.error, undefined, 'error')
669
+ t.equal(components.scheme, 'mailto', 'scheme')
670
+ t.equal(components.userinfo, undefined, 'userinfo')
671
+ t.equal(components.host, undefined, 'host')
672
+ t.equal(components.port, undefined, 'port')
673
+ t.equal(components.path, undefined, 'path')
674
+ t.equal(components.query, undefined, 'query')
675
+ t.equal(components.fragment, undefined, 'fragment')
676
+ t.deepEqual(components.to, ['chris@example.com'], 'to')
677
+ t.equal(components.subject, undefined, 'subject')
678
+ t.equal(components.body, undefined, 'body')
679
+ t.equal(components.headers, undefined, 'headers')
718
680
 
719
681
  components = URI.parse('mailto:infobot@example.com?subject=current-issue')
720
- deepEqual(components.to, ['infobot@example.com'], 'to')
721
- strictEqual(components.subject, 'current-issue', 'subject')
682
+ t.deepEqual(components.to, ['infobot@example.com'], 'to')
683
+ t.equal(components.subject, 'current-issue', 'subject')
722
684
 
723
685
  components = URI.parse('mailto:infobot@example.com?body=send%20current-issue')
724
- deepEqual(components.to, ['infobot@example.com'], 'to')
725
- strictEqual(components.body, 'send current-issue', 'body')
686
+ t.deepEqual(components.to, ['infobot@example.com'], 'to')
687
+ t.equal(components.body, 'send current-issue', 'body')
726
688
 
727
689
  components = URI.parse('mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index')
728
- deepEqual(components.to, ['infobot@example.com'], 'to')
729
- strictEqual(components.body, 'send current-issue\x0D\x0Asend index', 'body')
690
+ t.deepEqual(components.to, ['infobot@example.com'], 'to')
691
+ t.equal(components.body, 'send current-issue\x0D\x0Asend index', 'body')
730
692
 
731
693
  components = URI.parse('mailto:list@example.org?In-Reply-To=%3C3469A91.D10AF4C@example.com%3E')
732
- deepEqual(components.to, ['list@example.org'], 'to')
733
- deepEqual(components.headers, { 'In-Reply-To': '<3469A91.D10AF4C@example.com>' }, 'headers')
694
+ t.deepEqual(components.to, ['list@example.org'], 'to')
695
+ t.deepEqual(components.headers, { 'In-Reply-To': '<3469A91.D10AF4C@example.com>' }, 'headers')
734
696
 
735
697
  components = URI.parse('mailto:majordomo@example.com?body=subscribe%20bamboo-l')
736
- deepEqual(components.to, ['majordomo@example.com'], 'to')
737
- strictEqual(components.body, 'subscribe bamboo-l', 'body')
698
+ t.deepEqual(components.to, ['majordomo@example.com'], 'to')
699
+ t.equal(components.body, 'subscribe bamboo-l', 'body')
738
700
 
739
701
  components = URI.parse('mailto:joe@example.com?cc=bob@example.com&body=hello')
740
- deepEqual(components.to, ['joe@example.com'], 'to')
741
- strictEqual(components.body, 'hello', 'body')
742
- deepEqual(components.headers, { cc: 'bob@example.com' }, 'headers')
702
+ t.deepEqual(components.to, ['joe@example.com'], 'to')
703
+ t.equal(components.body, 'hello', 'body')
704
+ t.deepEqual(components.headers, { cc: 'bob@example.com' }, 'headers')
743
705
 
744
706
  components = URI.parse('mailto:joe@example.com?cc=bob@example.com?body=hello')
745
- if (URI.VALIDATE_SUPPORT) ok(components.error, 'invalid header fields')
707
+ if (URI.VALIDATE_SUPPORT) t.ok(components.error, 'invalid header fields')
746
708
 
747
709
  components = URI.parse('mailto:gorby%25kremvax@example.com')
748
- deepEqual(components.to, ['gorby%kremvax@example.com'], 'to gorby%kremvax@example.com')
710
+ t.deepEqual(components.to, ['gorby%kremvax@example.com'], 'to gorby%kremvax@example.com')
749
711
 
750
712
  components = URI.parse('mailto:unlikely%3Faddress@example.com?blat=foop')
751
- deepEqual(components.to, ['unlikely?address@example.com'], 'to unlikely?address@example.com')
752
- deepEqual(components.headers, { blat: 'foop' }, 'headers')
713
+ t.deepEqual(components.to, ['unlikely?address@example.com'], 'to unlikely?address@example.com')
714
+ t.deepEqual(components.headers, { blat: 'foop' }, 'headers')
753
715
 
754
716
  components = URI.parse('mailto:Mike%26family@example.org')
755
- deepEqual(components.to, ['Mike&family@example.org'], 'to Mike&family@example.org')
717
+ t.deepEqual(components.to, ['Mike&family@example.org'], 'to Mike&family@example.org')
756
718
 
757
719
  components = URI.parse('mailto:%22not%40me%22@example.org')
758
- deepEqual(components.to, ['"not@me"@example.org'], 'to ' + '"not@me"@example.org')
720
+ t.deepEqual(components.to, ['"not@me"@example.org'], 'to ' + '"not@me"@example.org')
759
721
 
760
722
  components = URI.parse('mailto:%22oh%5C%5Cno%22@example.org')
761
- deepEqual(components.to, ['"oh\\\\no"@example.org'], 'to ' + '"oh\\\\no"@example.org')
723
+ t.deepEqual(components.to, ['"oh\\\\no"@example.org'], 'to ' + '"oh\\\\no"@example.org')
762
724
 
763
725
  components = URI.parse("mailto:%22%5C%5C%5C%22it's%5C%20ugly%5C%5C%5C%22%22@example.org")
764
- deepEqual(components.to, ['"\\\\\\"it\'s\\ ugly\\\\\\""@example.org'], 'to ' + '"\\\\\\"it\'s\\ ugly\\\\\\""@example.org')
726
+ t.deepEqual(components.to, ['"\\\\\\"it\'s\\ ugly\\\\\\""@example.org'], 'to ' + '"\\\\\\"it\'s\\ ugly\\\\\\""@example.org')
765
727
 
766
728
  components = URI.parse('mailto:user@example.org?subject=caf%C3%A9')
767
- deepEqual(components.to, ['user@example.org'], 'to')
768
- strictEqual(components.subject, 'caf\xE9', 'subject')
729
+ t.deepEqual(components.to, ['user@example.org'], 'to')
730
+ t.equal(components.subject, 'caf\xE9', 'subject')
769
731
 
770
732
  components = URI.parse('mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D')
771
- deepEqual(components.to, ['user@example.org'], 'to')
772
- strictEqual(components.subject, '=?utf-8?Q?caf=C3=A9?=', 'subject') // TODO: Verify this
733
+ t.deepEqual(components.to, ['user@example.org'], 'to')
734
+ t.equal(components.subject, '=?utf-8?Q?caf=C3=A9?=', 'subject') // TODO: Verify this
773
735
 
774
736
  components = URI.parse('mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D')
775
- deepEqual(components.to, ['user@example.org'], 'to')
776
- strictEqual(components.subject, '=?iso-8859-1?Q?caf=E9?=', 'subject') // TODO: Verify this
737
+ t.deepEqual(components.to, ['user@example.org'], 'to')
738
+ t.equal(components.subject, '=?iso-8859-1?Q?caf=E9?=', 'subject') // TODO: Verify this
777
739
 
778
740
  components = URI.parse('mailto:user@example.org?subject=caf%C3%A9&body=caf%C3%A9')
779
- deepEqual(components.to, ['user@example.org'], 'to')
780
- strictEqual(components.subject, 'caf\xE9', 'subject')
781
- strictEqual(components.body, 'caf\xE9', 'body')
741
+ t.deepEqual(components.to, ['user@example.org'], 'to')
742
+ t.equal(components.subject, 'caf\xE9', 'subject')
743
+ t.equal(components.body, 'caf\xE9', 'body')
782
744
 
783
745
  if (URI.IRI_SUPPORT) {
784
746
  components = URI.parse('mailto:user@%E7%B4%8D%E8%B1%86.example.org?subject=Test&body=NATTO')
785
- deepEqual(components.to, ['user@xn--99zt52a.example.org'], 'to')
786
- strictEqual(components.subject, 'Test', 'subject')
787
- strictEqual(components.body, 'NATTO', 'body')
747
+ t.deepEqual(components.to, ['user@xn--99zt52a.example.org'], 'to')
748
+ t.equal(components.subject, 'Test', 'subject')
749
+ t.equal(components.body, 'NATTO', 'body')
788
750
  }
751
+
752
+ t.end()
789
753
  })
790
754
 
791
- test('Mailto Serialize', function () {
755
+ test('Mailto Serialize', (t) => {
792
756
  // tests from RFC 6068
793
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['chris@example.com'] }), 'mailto:chris@example.com')
794
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['infobot@example.com'], body: 'current-issue' }), 'mailto:infobot@example.com?body=current-issue')
795
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['infobot@example.com'], body: 'send current-issue' }), 'mailto:infobot@example.com?body=send%20current-issue')
796
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['infobot@example.com'], body: 'send current-issue\x0D\x0Asend index' }), 'mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index')
797
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['list@example.org'], headers: { 'In-Reply-To': '<3469A91.D10AF4C@example.com>' } }), 'mailto:list@example.org?In-Reply-To=%3C3469A91.D10AF4C@example.com%3E')
798
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['majordomo@example.com'], body: 'subscribe bamboo-l' }), 'mailto:majordomo@example.com?body=subscribe%20bamboo-l')
799
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['joe@example.com'], headers: { cc: 'bob@example.com', body: 'hello' } }), 'mailto:joe@example.com?cc=bob@example.com&body=hello')
800
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['gorby%25kremvax@example.com'] }), 'mailto:gorby%25kremvax@example.com')
801
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['unlikely%3Faddress@example.com'], headers: { blat: 'foop' } }), 'mailto:unlikely%3Faddress@example.com?blat=foop')
802
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['Mike&family@example.org'] }), 'mailto:Mike%26family@example.org')
803
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['"not@me"@example.org'] }), 'mailto:%22not%40me%22@example.org')
804
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['"oh\\\\no"@example.org'] }), 'mailto:%22oh%5C%5Cno%22@example.org')
805
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['"\\\\\\"it\'s\\ ugly\\\\\\""@example.org'] }), "mailto:%22%5C%5C%5C%22it's%5C%20ugly%5C%5C%5C%22%22@example.org")
806
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: 'caf\xE9' }), 'mailto:user@example.org?subject=caf%C3%A9')
807
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: '=?utf-8?Q?caf=C3=A9?=' }), 'mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D')
808
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: '=?iso-8859-1?Q?caf=E9?=' }), 'mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D')
809
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: 'caf\xE9', body: 'caf\xE9' }), 'mailto:user@example.org?subject=caf%C3%A9&body=caf%C3%A9')
757
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['chris@example.com'] }), 'mailto:chris@example.com')
758
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['infobot@example.com'], body: 'current-issue' }), 'mailto:infobot@example.com?body=current-issue')
759
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['infobot@example.com'], body: 'send current-issue' }), 'mailto:infobot@example.com?body=send%20current-issue')
760
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['infobot@example.com'], body: 'send current-issue\x0D\x0Asend index' }), 'mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index')
761
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['list@example.org'], headers: { 'In-Reply-To': '<3469A91.D10AF4C@example.com>' } }), 'mailto:list@example.org?In-Reply-To=%3C3469A91.D10AF4C@example.com%3E')
762
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['majordomo@example.com'], body: 'subscribe bamboo-l' }), 'mailto:majordomo@example.com?body=subscribe%20bamboo-l')
763
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['joe@example.com'], headers: { cc: 'bob@example.com', body: 'hello' } }), 'mailto:joe@example.com?cc=bob@example.com&body=hello')
764
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['gorby%25kremvax@example.com'] }), 'mailto:gorby%25kremvax@example.com')
765
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['unlikely%3Faddress@example.com'], headers: { blat: 'foop' } }), 'mailto:unlikely%3Faddress@example.com?blat=foop')
766
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['Mike&family@example.org'] }), 'mailto:Mike%26family@example.org')
767
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['"not@me"@example.org'] }), 'mailto:%22not%40me%22@example.org')
768
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['"oh\\\\no"@example.org'] }), 'mailto:%22oh%5C%5Cno%22@example.org')
769
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['"\\\\\\"it\'s\\ ugly\\\\\\""@example.org'] }), "mailto:%22%5C%5C%5C%22it's%5C%20ugly%5C%5C%5C%22%22@example.org")
770
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: 'caf\xE9' }), 'mailto:user@example.org?subject=caf%C3%A9')
771
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: '=?utf-8?Q?caf=C3=A9?=' }), 'mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D')
772
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: '=?iso-8859-1?Q?caf=E9?=' }), 'mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D')
773
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: 'caf\xE9', body: 'caf\xE9' }), 'mailto:user@example.org?subject=caf%C3%A9&body=caf%C3%A9')
810
774
  if (URI.IRI_SUPPORT) {
811
- strictEqual(URI.serialize({ scheme: 'mailto', to: ['us\xE9r@\u7d0d\u8c46.example.org'], subject: 'Test', body: 'NATTO' }), 'mailto:us%C3%A9r@xn--99zt52a.example.org?subject=Test&body=NATTO')
775
+ t.equal(URI.serialize({ scheme: 'mailto', to: ['us\xE9r@\u7d0d\u8c46.example.org'], subject: 'Test', body: 'NATTO' }), 'mailto:us%C3%A9r@xn--99zt52a.example.org?subject=Test&body=NATTO')
812
776
  }
777
+ t.end()
813
778
  })
814
779
 
815
- test('Mailto Equals', function () {
780
+ test('Mailto Equals', (t) => {
816
781
  // tests from RFC 6068
817
- strictEqual(URI.equal('mailto:addr1@an.example,addr2@an.example', 'mailto:?to=addr1@an.example,addr2@an.example'), true)
818
- strictEqual(URI.equal('mailto:?to=addr1@an.example,addr2@an.example', 'mailto:addr1@an.example?to=addr2@an.example'), true)
782
+ t.equal(URI.equal('mailto:addr1@an.example,addr2@an.example', 'mailto:?to=addr1@an.example,addr2@an.example'), true)
783
+ t.equal(URI.equal('mailto:?to=addr1@an.example,addr2@an.example', 'mailto:addr1@an.example?to=addr2@an.example'), true)
784
+ t.end()
819
785
  })
820
786
  }
821
787
 
822
788
  if (URI.SCHEMES.ws) {
823
- // module("WS");
824
-
825
- test('WS Parse', function () {
789
+ test('WS Parse', (t) => {
826
790
  let components
827
791
 
828
792
  // example from RFC 6455, Sec 4.1
829
793
  components = URI.parse('ws://example.com/chat')
830
- strictEqual(components.error, undefined, 'error')
831
- strictEqual(components.scheme, 'ws', 'scheme')
832
- strictEqual(components.userinfo, undefined, 'userinfo')
833
- strictEqual(components.host, 'example.com', 'host')
834
- strictEqual(components.port, undefined, 'port')
835
- strictEqual(components.path, undefined, 'path')
836
- strictEqual(components.query, undefined, 'query')
837
- strictEqual(components.fragment, undefined, 'fragment')
838
- strictEqual(components.resourceName, '/chat', 'resourceName')
839
- strictEqual(components.secure, false, 'secure')
794
+ t.equal(components.error, undefined, 'error')
795
+ t.equal(components.scheme, 'ws', 'scheme')
796
+ t.equal(components.userinfo, undefined, 'userinfo')
797
+ t.equal(components.host, 'example.com', 'host')
798
+ t.equal(components.port, undefined, 'port')
799
+ t.equal(components.path, undefined, 'path')
800
+ t.equal(components.query, undefined, 'query')
801
+ t.equal(components.fragment, undefined, 'fragment')
802
+ t.equal(components.resourceName, '/chat', 'resourceName')
803
+ t.equal(components.secure, false, 'secure')
840
804
 
841
805
  components = URI.parse('ws://example.com/foo?bar=baz')
842
- strictEqual(components.error, undefined, 'error')
843
- strictEqual(components.scheme, 'ws', 'scheme')
844
- strictEqual(components.userinfo, undefined, 'userinfo')
845
- strictEqual(components.host, 'example.com', 'host')
846
- strictEqual(components.port, undefined, 'port')
847
- strictEqual(components.path, undefined, 'path')
848
- strictEqual(components.query, undefined, 'query')
849
- strictEqual(components.fragment, undefined, 'fragment')
850
- strictEqual(components.resourceName, '/foo?bar=baz', 'resourceName')
851
- strictEqual(components.secure, false, 'secure')
806
+ t.equal(components.error, undefined, 'error')
807
+ t.equal(components.scheme, 'ws', 'scheme')
808
+ t.equal(components.userinfo, undefined, 'userinfo')
809
+ t.equal(components.host, 'example.com', 'host')
810
+ t.equal(components.port, undefined, 'port')
811
+ t.equal(components.path, undefined, 'path')
812
+ t.equal(components.query, undefined, 'query')
813
+ t.equal(components.fragment, undefined, 'fragment')
814
+ t.equal(components.resourceName, '/foo?bar=baz', 'resourceName')
815
+ t.equal(components.secure, false, 'secure')
852
816
 
853
817
  components = URI.parse('ws://example.com/?bar=baz')
854
- strictEqual(components.resourceName, '/?bar=baz', 'resourceName')
818
+ t.equal(components.resourceName, '/?bar=baz', 'resourceName')
819
+
820
+ t.end()
855
821
  })
856
822
 
857
- test('WS Serialize', function () {
858
- strictEqual(URI.serialize({ scheme: 'ws' }), 'ws:')
859
- strictEqual(URI.serialize({ scheme: 'ws', host: 'example.com' }), 'ws://example.com')
860
- strictEqual(URI.serialize({ scheme: 'ws', resourceName: '/' }), 'ws:')
861
- strictEqual(URI.serialize({ scheme: 'ws', resourceName: '/foo' }), 'ws:/foo')
862
- strictEqual(URI.serialize({ scheme: 'ws', resourceName: '/foo?bar' }), 'ws:/foo?bar')
863
- strictEqual(URI.serialize({ scheme: 'ws', secure: false }), 'ws:')
864
- strictEqual(URI.serialize({ scheme: 'ws', secure: true }), 'wss:')
865
- strictEqual(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo' }), 'ws://example.com/foo')
866
- strictEqual(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar' }), 'ws://example.com/foo?bar')
867
- strictEqual(URI.serialize({ scheme: 'ws', host: 'example.com', secure: false }), 'ws://example.com')
868
- strictEqual(URI.serialize({ scheme: 'ws', host: 'example.com', secure: true }), 'wss://example.com')
869
- strictEqual(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
870
- strictEqual(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
823
+ test('WS Serialize', (t) => {
824
+ t.equal(URI.serialize({ scheme: 'ws' }), 'ws:')
825
+ t.equal(URI.serialize({ scheme: 'ws', host: 'example.com' }), 'ws://example.com')
826
+ t.equal(URI.serialize({ scheme: 'ws', resourceName: '/' }), 'ws:')
827
+ t.equal(URI.serialize({ scheme: 'ws', resourceName: '/foo' }), 'ws:/foo')
828
+ t.equal(URI.serialize({ scheme: 'ws', resourceName: '/foo?bar' }), 'ws:/foo?bar')
829
+ t.equal(URI.serialize({ scheme: 'ws', secure: false }), 'ws:')
830
+ t.equal(URI.serialize({ scheme: 'ws', secure: true }), 'wss:')
831
+ t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo' }), 'ws://example.com/foo')
832
+ t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar' }), 'ws://example.com/foo?bar')
833
+ t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', secure: false }), 'ws://example.com')
834
+ t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', secure: true }), 'wss://example.com')
835
+ t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
836
+ t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
837
+ t.end()
871
838
  })
872
839
 
873
- test('WS Equal', function () {
874
- strictEqual(URI.equal('WS://ABC.COM:80/chat#one', 'ws://abc.com/chat'), true)
840
+ test('WS Equal', (t) => {
841
+ t.equal(URI.equal('WS://ABC.COM:80/chat#one', 'ws://abc.com/chat'), true)
842
+ t.end()
875
843
  })
876
844
 
877
- test('WS Normalize', function () {
878
- strictEqual(URI.normalize('ws://example.com:80/foo#hash'), 'ws://example.com/foo')
845
+ test('WS Normalize', (t) => {
846
+ t.equal(URI.normalize('ws://example.com:80/foo#hash'), 'ws://example.com/foo')
847
+ t.end()
879
848
  })
880
849
  }
881
850
 
882
851
  if (URI.SCHEMES.wss) {
883
- // module("WSS");
884
-
885
- test('WSS Parse', function () {
852
+ test('WSS Parse', (t) => {
886
853
  let components
887
854
 
888
855
  // example from RFC 6455, Sec 4.1
889
856
  components = URI.parse('wss://example.com/chat')
890
- strictEqual(components.error, undefined, 'error')
891
- strictEqual(components.scheme, 'wss', 'scheme')
892
- strictEqual(components.userinfo, undefined, 'userinfo')
893
- strictEqual(components.host, 'example.com', 'host')
894
- strictEqual(components.port, undefined, 'port')
895
- strictEqual(components.path, undefined, 'path')
896
- strictEqual(components.query, undefined, 'query')
897
- strictEqual(components.fragment, undefined, 'fragment')
898
- strictEqual(components.resourceName, '/chat', 'resourceName')
899
- strictEqual(components.secure, true, 'secure')
857
+ t.equal(components.error, undefined, 'error')
858
+ t.equal(components.scheme, 'wss', 'scheme')
859
+ t.equal(components.userinfo, undefined, 'userinfo')
860
+ t.equal(components.host, 'example.com', 'host')
861
+ t.equal(components.port, undefined, 'port')
862
+ t.equal(components.path, undefined, 'path')
863
+ t.equal(components.query, undefined, 'query')
864
+ t.equal(components.fragment, undefined, 'fragment')
865
+ t.equal(components.resourceName, '/chat', 'resourceName')
866
+ t.equal(components.secure, true, 'secure')
900
867
 
901
868
  components = URI.parse('wss://example.com/foo?bar=baz')
902
- strictEqual(components.error, undefined, 'error')
903
- strictEqual(components.scheme, 'wss', 'scheme')
904
- strictEqual(components.userinfo, undefined, 'userinfo')
905
- strictEqual(components.host, 'example.com', 'host')
906
- strictEqual(components.port, undefined, 'port')
907
- strictEqual(components.path, undefined, 'path')
908
- strictEqual(components.query, undefined, 'query')
909
- strictEqual(components.fragment, undefined, 'fragment')
910
- strictEqual(components.resourceName, '/foo?bar=baz', 'resourceName')
911
- strictEqual(components.secure, true, 'secure')
869
+ t.equal(components.error, undefined, 'error')
870
+ t.equal(components.scheme, 'wss', 'scheme')
871
+ t.equal(components.userinfo, undefined, 'userinfo')
872
+ t.equal(components.host, 'example.com', 'host')
873
+ t.equal(components.port, undefined, 'port')
874
+ t.equal(components.path, undefined, 'path')
875
+ t.equal(components.query, undefined, 'query')
876
+ t.equal(components.fragment, undefined, 'fragment')
877
+ t.equal(components.resourceName, '/foo?bar=baz', 'resourceName')
878
+ t.equal(components.secure, true, 'secure')
912
879
 
913
880
  components = URI.parse('wss://example.com/?bar=baz')
914
- strictEqual(components.resourceName, '/?bar=baz', 'resourceName')
881
+ t.equal(components.resourceName, '/?bar=baz', 'resourceName')
882
+
883
+ t.end()
915
884
  })
916
885
 
917
- test('WSS Serialize', function () {
918
- strictEqual(URI.serialize({ scheme: 'wss' }), 'wss:')
919
- strictEqual(URI.serialize({ scheme: 'wss', host: 'example.com' }), 'wss://example.com')
920
- strictEqual(URI.serialize({ scheme: 'wss', resourceName: '/' }), 'wss:')
921
- strictEqual(URI.serialize({ scheme: 'wss', resourceName: '/foo' }), 'wss:/foo')
922
- strictEqual(URI.serialize({ scheme: 'wss', resourceName: '/foo?bar' }), 'wss:/foo?bar')
923
- strictEqual(URI.serialize({ scheme: 'wss', secure: false }), 'ws:')
924
- strictEqual(URI.serialize({ scheme: 'wss', secure: true }), 'wss:')
925
- strictEqual(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo' }), 'wss://example.com/foo')
926
- strictEqual(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar' }), 'wss://example.com/foo?bar')
927
- strictEqual(URI.serialize({ scheme: 'wss', host: 'example.com', secure: false }), 'ws://example.com')
928
- strictEqual(URI.serialize({ scheme: 'wss', host: 'example.com', secure: true }), 'wss://example.com')
929
- strictEqual(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
930
- strictEqual(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
886
+ test('WSS Serialize', (t) => {
887
+ t.equal(URI.serialize({ scheme: 'wss' }), 'wss:')
888
+ t.equal(URI.serialize({ scheme: 'wss', host: 'example.com' }), 'wss://example.com')
889
+ t.equal(URI.serialize({ scheme: 'wss', resourceName: '/' }), 'wss:')
890
+ t.equal(URI.serialize({ scheme: 'wss', resourceName: '/foo' }), 'wss:/foo')
891
+ t.equal(URI.serialize({ scheme: 'wss', resourceName: '/foo?bar' }), 'wss:/foo?bar')
892
+ t.equal(URI.serialize({ scheme: 'wss', secure: false }), 'ws:')
893
+ t.equal(URI.serialize({ scheme: 'wss', secure: true }), 'wss:')
894
+ t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo' }), 'wss://example.com/foo')
895
+ t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar' }), 'wss://example.com/foo?bar')
896
+ t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', secure: false }), 'ws://example.com')
897
+ t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', secure: true }), 'wss://example.com')
898
+ t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
899
+ t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
900
+ t.end()
931
901
  })
932
902
 
933
- test('WSS Equal', function () {
934
- strictEqual(URI.equal('WSS://ABC.COM:443/chat#one', 'wss://abc.com/chat'), true)
903
+ test('WSS Equal', (t) => {
904
+ t.equal(URI.equal('WSS://ABC.COM:443/chat#one', 'wss://abc.com/chat'), true)
905
+ t.end()
935
906
  })
936
907
 
937
- test('WSS Normalize', function () {
938
- strictEqual(URI.normalize('wss://example.com:443/foo#hash'), 'wss://example.com/foo')
908
+ test('WSS Normalize', (t) => {
909
+ t.equal(URI.normalize('wss://example.com:443/foo#hash'), 'wss://example.com/foo')
910
+ t.end()
939
911
  })
940
912
  }