fastify 5.3.2 → 5.3.3
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.
- package/.vscode/settings.json +22 -0
- package/docs/Guides/Ecosystem.md +7 -2
- package/docs/Guides/Serverless.md +28 -69
- package/docs/Reference/Errors.md +0 -2
- package/docs/Reference/Server.md +17 -1
- package/eslint.config.js +17 -9
- package/fastify.js +6 -2
- package/lib/decorate.js +2 -2
- package/lib/errors.js +0 -8
- package/lib/logger-factory.js +1 -1
- package/lib/logger-pino.js +2 -2
- package/lib/reply.js +2 -2
- package/lib/request.js +1 -1
- package/lib/server.js +30 -51
- package/package.json +4 -4
- package/test/close-pipelining.test.js +5 -4
- package/test/decorator.test.js +422 -341
- package/test/helper.js +107 -69
- package/test/hooks.on-listen.test.js +255 -239
- package/test/hooks.on-ready.test.js +110 -92
- package/test/inject.test.js +114 -97
- package/test/input-validation.js +63 -53
- package/test/internals/errors.test.js +1 -11
- package/test/internals/hooks.test.js +17 -0
- package/test/issue-4959.test.js +2 -2
- package/test/logger/response.test.js +19 -20
- package/test/options.error-handler.test.js +1 -1
- package/test/options.test.js +1 -1
- package/test/output-validation.test.js +49 -70
- package/test/patch.error-handler.test.js +1 -1
- package/test/patch.test.js +1 -1
- package/test/plugin.1.test.js +71 -60
- package/test/promises.test.js +36 -30
- package/test/put.error-handler.test.js +1 -1
- package/test/put.test.js +1 -1
- package/test/reply-error.test.js +169 -148
- package/test/reply-trailers.test.js +119 -108
- package/test/schema-feature.test.js +309 -238
- package/test/schema-validation.test.js +44 -2
- package/test/stream.1.test.js +30 -27
- package/test/stream.2.test.js +20 -10
- package/test/stream.3.test.js +37 -31
- package/test/types/errors.test-d.ts +0 -1
- package/test/types/plugin.test-d.ts +1 -1
- package/test/types/register.test-d.ts +1 -1
- package/test/use-semicolon-delimiter.test.js +1 -1
- package/types/errors.d.ts +0 -1
- package/test/http2/missing-http2-module.test.js +0 -17
package/test/inject.test.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const test = t.test
|
|
3
|
+
const { test } = require('node:test')
|
|
5
4
|
const Stream = require('node:stream')
|
|
6
5
|
const util = require('node:util')
|
|
7
6
|
const Fastify = require('..')
|
|
@@ -10,11 +9,11 @@ const { Readable } = require('node:stream')
|
|
|
10
9
|
test('inject should exist', t => {
|
|
11
10
|
t.plan(2)
|
|
12
11
|
const fastify = Fastify()
|
|
13
|
-
t.ok(fastify.inject)
|
|
14
|
-
t.
|
|
12
|
+
t.assert.ok(fastify.inject)
|
|
13
|
+
t.assert.strictEqual(typeof fastify.inject, 'function')
|
|
15
14
|
})
|
|
16
15
|
|
|
17
|
-
test('should wait for the ready event', t => {
|
|
16
|
+
test('should wait for the ready event', (t, done) => {
|
|
18
17
|
t.plan(4)
|
|
19
18
|
const fastify = Fastify()
|
|
20
19
|
const payload = { hello: 'world' }
|
|
@@ -23,7 +22,6 @@ test('should wait for the ready event', t => {
|
|
|
23
22
|
instance.get('/', (req, reply) => {
|
|
24
23
|
reply.send(payload)
|
|
25
24
|
})
|
|
26
|
-
|
|
27
25
|
setTimeout(done, 500)
|
|
28
26
|
})
|
|
29
27
|
|
|
@@ -31,14 +29,15 @@ test('should wait for the ready event', t => {
|
|
|
31
29
|
method: 'GET',
|
|
32
30
|
url: '/'
|
|
33
31
|
}, (err, res) => {
|
|
34
|
-
t.
|
|
35
|
-
t.
|
|
36
|
-
t.
|
|
37
|
-
t.
|
|
32
|
+
t.assert.ifError(err)
|
|
33
|
+
t.assert.deepStrictEqual(payload, JSON.parse(res.payload))
|
|
34
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
35
|
+
t.assert.strictEqual(res.headers['content-length'], '17')
|
|
36
|
+
done()
|
|
38
37
|
})
|
|
39
38
|
})
|
|
40
39
|
|
|
41
|
-
test('inject get request', t => {
|
|
40
|
+
test('inject get request', (t, done) => {
|
|
42
41
|
t.plan(4)
|
|
43
42
|
const fastify = Fastify()
|
|
44
43
|
const payload = { hello: 'world' }
|
|
@@ -51,14 +50,15 @@ test('inject get request', t => {
|
|
|
51
50
|
method: 'GET',
|
|
52
51
|
url: '/'
|
|
53
52
|
}, (err, res) => {
|
|
54
|
-
t.
|
|
55
|
-
t.
|
|
56
|
-
t.
|
|
57
|
-
t.
|
|
53
|
+
t.assert.ifError(err)
|
|
54
|
+
t.assert.deepStrictEqual(payload, JSON.parse(res.payload))
|
|
55
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
56
|
+
t.assert.strictEqual(res.headers['content-length'], '17')
|
|
57
|
+
done()
|
|
58
58
|
})
|
|
59
59
|
})
|
|
60
60
|
|
|
61
|
-
test('inject get request - code check', t => {
|
|
61
|
+
test('inject get request - code check', (t, done) => {
|
|
62
62
|
t.plan(4)
|
|
63
63
|
const fastify = Fastify()
|
|
64
64
|
const payload = { hello: 'world' }
|
|
@@ -71,14 +71,15 @@ test('inject get request - code check', t => {
|
|
|
71
71
|
method: 'GET',
|
|
72
72
|
url: '/'
|
|
73
73
|
}, (err, res) => {
|
|
74
|
-
t.
|
|
75
|
-
t.
|
|
76
|
-
t.
|
|
77
|
-
t.
|
|
74
|
+
t.assert.ifError(err)
|
|
75
|
+
t.assert.deepStrictEqual(payload, JSON.parse(res.payload))
|
|
76
|
+
t.assert.strictEqual(res.statusCode, 201)
|
|
77
|
+
t.assert.strictEqual(res.headers['content-length'], '17')
|
|
78
|
+
done()
|
|
78
79
|
})
|
|
79
80
|
})
|
|
80
81
|
|
|
81
|
-
test('inject get request - headers check', t => {
|
|
82
|
+
test('inject get request - headers check', (t, done) => {
|
|
82
83
|
t.plan(4)
|
|
83
84
|
const fastify = Fastify()
|
|
84
85
|
|
|
@@ -90,14 +91,15 @@ test('inject get request - headers check', t => {
|
|
|
90
91
|
method: 'GET',
|
|
91
92
|
url: '/'
|
|
92
93
|
}, (err, res) => {
|
|
93
|
-
t.
|
|
94
|
-
t.
|
|
95
|
-
t.
|
|
96
|
-
t.
|
|
94
|
+
t.assert.ifError(err)
|
|
95
|
+
t.assert.strictEqual('', res.payload)
|
|
96
|
+
t.assert.strictEqual(res.headers['content-type'], 'text/plain')
|
|
97
|
+
t.assert.strictEqual(res.headers['content-length'], '0')
|
|
98
|
+
done()
|
|
97
99
|
})
|
|
98
100
|
})
|
|
99
101
|
|
|
100
|
-
test('inject get request - querystring', t => {
|
|
102
|
+
test('inject get request - querystring', (t, done) => {
|
|
101
103
|
t.plan(4)
|
|
102
104
|
const fastify = Fastify()
|
|
103
105
|
|
|
@@ -109,14 +111,15 @@ test('inject get request - querystring', t => {
|
|
|
109
111
|
method: 'GET',
|
|
110
112
|
url: '/?hello=world'
|
|
111
113
|
}, (err, res) => {
|
|
112
|
-
t.
|
|
113
|
-
t.
|
|
114
|
-
t.
|
|
115
|
-
t.
|
|
114
|
+
t.assert.ifError(err)
|
|
115
|
+
t.assert.deepStrictEqual({ hello: 'world' }, JSON.parse(res.payload))
|
|
116
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
117
|
+
t.assert.strictEqual(res.headers['content-length'], '17')
|
|
118
|
+
done()
|
|
116
119
|
})
|
|
117
120
|
})
|
|
118
121
|
|
|
119
|
-
test('inject get request - params', t => {
|
|
122
|
+
test('inject get request - params', (t, done) => {
|
|
120
123
|
t.plan(4)
|
|
121
124
|
const fastify = Fastify()
|
|
122
125
|
|
|
@@ -128,14 +131,15 @@ test('inject get request - params', t => {
|
|
|
128
131
|
method: 'GET',
|
|
129
132
|
url: '/world'
|
|
130
133
|
}, (err, res) => {
|
|
131
|
-
t.
|
|
132
|
-
t.
|
|
133
|
-
t.
|
|
134
|
-
t.
|
|
134
|
+
t.assert.ifError(err)
|
|
135
|
+
t.assert.deepStrictEqual({ hello: 'world' }, JSON.parse(res.payload))
|
|
136
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
137
|
+
t.assert.strictEqual(res.headers['content-length'], '17')
|
|
138
|
+
done()
|
|
135
139
|
})
|
|
136
140
|
})
|
|
137
141
|
|
|
138
|
-
test('inject get request - wildcard', t => {
|
|
142
|
+
test('inject get request - wildcard', (t, done) => {
|
|
139
143
|
t.plan(4)
|
|
140
144
|
const fastify = Fastify()
|
|
141
145
|
|
|
@@ -147,14 +151,15 @@ test('inject get request - wildcard', t => {
|
|
|
147
151
|
method: 'GET',
|
|
148
152
|
url: '/test/wildcard'
|
|
149
153
|
}, (err, res) => {
|
|
150
|
-
t.
|
|
151
|
-
t.
|
|
152
|
-
t.
|
|
153
|
-
t.
|
|
154
|
+
t.assert.ifError(err)
|
|
155
|
+
t.assert.deepStrictEqual({ '*': 'wildcard' }, JSON.parse(res.payload))
|
|
156
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
157
|
+
t.assert.strictEqual(res.headers['content-length'], '16')
|
|
158
|
+
done()
|
|
154
159
|
})
|
|
155
160
|
})
|
|
156
161
|
|
|
157
|
-
test('inject get request - headers', t => {
|
|
162
|
+
test('inject get request - headers', (t, done) => {
|
|
158
163
|
t.plan(4)
|
|
159
164
|
const fastify = Fastify()
|
|
160
165
|
|
|
@@ -167,14 +172,15 @@ test('inject get request - headers', t => {
|
|
|
167
172
|
url: '/',
|
|
168
173
|
headers: { hello: 'world' }
|
|
169
174
|
}, (err, res) => {
|
|
170
|
-
t.
|
|
171
|
-
t.
|
|
172
|
-
t.
|
|
173
|
-
t.
|
|
175
|
+
t.assert.ifError(err)
|
|
176
|
+
t.assert.strictEqual('world', JSON.parse(res.payload).hello)
|
|
177
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
178
|
+
t.assert.strictEqual(res.headers['content-length'], '69')
|
|
179
|
+
done()
|
|
174
180
|
})
|
|
175
181
|
})
|
|
176
182
|
|
|
177
|
-
test('inject post request', t => {
|
|
183
|
+
test('inject post request', (t, done) => {
|
|
178
184
|
t.plan(4)
|
|
179
185
|
const fastify = Fastify()
|
|
180
186
|
const payload = { hello: 'world' }
|
|
@@ -188,14 +194,15 @@ test('inject post request', t => {
|
|
|
188
194
|
url: '/',
|
|
189
195
|
payload
|
|
190
196
|
}, (err, res) => {
|
|
191
|
-
t.
|
|
192
|
-
t.
|
|
193
|
-
t.
|
|
194
|
-
t.
|
|
197
|
+
t.assert.ifError(err)
|
|
198
|
+
t.assert.deepStrictEqual(payload, JSON.parse(res.payload))
|
|
199
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
200
|
+
t.assert.strictEqual(res.headers['content-length'], '17')
|
|
201
|
+
done()
|
|
195
202
|
})
|
|
196
203
|
})
|
|
197
204
|
|
|
198
|
-
test('inject post request - send stream', t => {
|
|
205
|
+
test('inject post request - send stream', (t, done) => {
|
|
199
206
|
t.plan(4)
|
|
200
207
|
const fastify = Fastify()
|
|
201
208
|
|
|
@@ -209,14 +216,15 @@ test('inject post request - send stream', t => {
|
|
|
209
216
|
headers: { 'content-type': 'application/json' },
|
|
210
217
|
payload: getStream()
|
|
211
218
|
}, (err, res) => {
|
|
212
|
-
t.
|
|
213
|
-
t.
|
|
214
|
-
t.
|
|
215
|
-
t.
|
|
219
|
+
t.assert.ifError(err)
|
|
220
|
+
t.assert.deepStrictEqual('{"hello":"world"}', res.payload)
|
|
221
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
222
|
+
t.assert.strictEqual(res.headers['content-length'], '17')
|
|
223
|
+
done()
|
|
216
224
|
})
|
|
217
225
|
})
|
|
218
226
|
|
|
219
|
-
test('inject get request - reply stream', t => {
|
|
227
|
+
test('inject get request - reply stream', (t, done) => {
|
|
220
228
|
t.plan(3)
|
|
221
229
|
const fastify = Fastify()
|
|
222
230
|
|
|
@@ -228,13 +236,14 @@ test('inject get request - reply stream', t => {
|
|
|
228
236
|
method: 'GET',
|
|
229
237
|
url: '/'
|
|
230
238
|
}, (err, res) => {
|
|
231
|
-
t.
|
|
232
|
-
t.
|
|
233
|
-
t.
|
|
239
|
+
t.assert.ifError(err)
|
|
240
|
+
t.assert.deepStrictEqual('{"hello":"world"}', res.payload)
|
|
241
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
242
|
+
done()
|
|
234
243
|
})
|
|
235
244
|
})
|
|
236
245
|
|
|
237
|
-
test('inject promisify - waiting for ready event', t => {
|
|
246
|
+
test('inject promisify - waiting for ready event', (t, done) => {
|
|
238
247
|
t.plan(1)
|
|
239
248
|
const fastify = Fastify()
|
|
240
249
|
const payload = { hello: 'world' }
|
|
@@ -249,12 +258,13 @@ test('inject promisify - waiting for ready event', t => {
|
|
|
249
258
|
}
|
|
250
259
|
fastify.inject(injectParams)
|
|
251
260
|
.then(res => {
|
|
252
|
-
t.
|
|
261
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
262
|
+
done()
|
|
253
263
|
})
|
|
254
|
-
.catch(t.fail)
|
|
264
|
+
.catch(t.assert.fail)
|
|
255
265
|
})
|
|
256
266
|
|
|
257
|
-
test('inject promisify - after the ready event', t => {
|
|
267
|
+
test('inject promisify - after the ready event', (t, done) => {
|
|
258
268
|
t.plan(2)
|
|
259
269
|
const fastify = Fastify()
|
|
260
270
|
const payload = { hello: 'world' }
|
|
@@ -264,7 +274,7 @@ test('inject promisify - after the ready event', t => {
|
|
|
264
274
|
})
|
|
265
275
|
|
|
266
276
|
fastify.ready(err => {
|
|
267
|
-
t.
|
|
277
|
+
t.assert.ifError(err)
|
|
268
278
|
|
|
269
279
|
const injectParams = {
|
|
270
280
|
method: 'GET',
|
|
@@ -272,13 +282,14 @@ test('inject promisify - after the ready event', t => {
|
|
|
272
282
|
}
|
|
273
283
|
fastify.inject(injectParams)
|
|
274
284
|
.then(res => {
|
|
275
|
-
t.
|
|
285
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
286
|
+
done()
|
|
276
287
|
})
|
|
277
|
-
.catch(t.fail)
|
|
288
|
+
.catch(t.assert.fail)
|
|
278
289
|
})
|
|
279
290
|
})
|
|
280
291
|
|
|
281
|
-
test('inject promisify - when the server is up', t => {
|
|
292
|
+
test('inject promisify - when the server is up', (t, done) => {
|
|
282
293
|
t.plan(2)
|
|
283
294
|
const fastify = Fastify()
|
|
284
295
|
const payload = { hello: 'world' }
|
|
@@ -288,7 +299,7 @@ test('inject promisify - when the server is up', t => {
|
|
|
288
299
|
})
|
|
289
300
|
|
|
290
301
|
fastify.ready(err => {
|
|
291
|
-
t.
|
|
302
|
+
t.assert.ifError(err)
|
|
292
303
|
|
|
293
304
|
// setTimeout because the ready event don't set "started" flag
|
|
294
305
|
// in this iteration of the 'event loop'
|
|
@@ -299,14 +310,15 @@ test('inject promisify - when the server is up', t => {
|
|
|
299
310
|
}
|
|
300
311
|
fastify.inject(injectParams)
|
|
301
312
|
.then(res => {
|
|
302
|
-
t.
|
|
313
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
314
|
+
done()
|
|
303
315
|
})
|
|
304
|
-
.catch(t.fail)
|
|
316
|
+
.catch(t.assert.fail)
|
|
305
317
|
}, 10)
|
|
306
318
|
})
|
|
307
319
|
})
|
|
308
320
|
|
|
309
|
-
test('should reject in error case', t => {
|
|
321
|
+
test('should reject in error case', (t, done) => {
|
|
310
322
|
t.plan(1)
|
|
311
323
|
const fastify = Fastify()
|
|
312
324
|
|
|
@@ -320,11 +332,12 @@ test('should reject in error case', t => {
|
|
|
320
332
|
url: '/'
|
|
321
333
|
})
|
|
322
334
|
.catch(e => {
|
|
323
|
-
t.
|
|
335
|
+
t.assert.strictEqual(e, error)
|
|
336
|
+
done()
|
|
324
337
|
})
|
|
325
338
|
})
|
|
326
339
|
|
|
327
|
-
test('inject a multipart request using form-body', t => {
|
|
340
|
+
test('inject a multipart request using form-body', (t, done) => {
|
|
328
341
|
t.plan(2)
|
|
329
342
|
const fastify = Fastify()
|
|
330
343
|
|
|
@@ -350,8 +363,9 @@ test('inject a multipart request using form-body', t => {
|
|
|
350
363
|
payload: form
|
|
351
364
|
})
|
|
352
365
|
.then(response => {
|
|
353
|
-
t.
|
|
354
|
-
t.ok(/Content-Disposition: form-data; name="my_field"/.test(response.payload))
|
|
366
|
+
t.assert.strictEqual(response.statusCode, 200)
|
|
367
|
+
t.assert.ok(/Content-Disposition: form-data; name="my_field"/.test(response.payload))
|
|
368
|
+
done()
|
|
355
369
|
})
|
|
356
370
|
})
|
|
357
371
|
|
|
@@ -371,28 +385,29 @@ function getStream () {
|
|
|
371
385
|
return new Read()
|
|
372
386
|
}
|
|
373
387
|
|
|
374
|
-
test('should error the promise if ready errors', t => {
|
|
388
|
+
test('should error the promise if ready errors', (t, done) => {
|
|
375
389
|
t.plan(3)
|
|
376
390
|
const fastify = Fastify()
|
|
377
391
|
|
|
378
392
|
fastify.register((instance, opts) => {
|
|
379
393
|
return Promise.reject(new Error('kaboom'))
|
|
380
394
|
}).after(function () {
|
|
381
|
-
t.
|
|
395
|
+
t.assert.ok('after is called')
|
|
382
396
|
})
|
|
383
397
|
|
|
384
398
|
fastify.inject({
|
|
385
399
|
method: 'GET',
|
|
386
400
|
url: '/'
|
|
387
401
|
}).then(() => {
|
|
388
|
-
t.fail('this should not be called')
|
|
402
|
+
t.assert.fail('this should not be called')
|
|
389
403
|
}).catch(err => {
|
|
390
|
-
t.ok(err)
|
|
391
|
-
t.
|
|
404
|
+
t.assert.ok(err)
|
|
405
|
+
t.assert.strictEqual(err.message, 'kaboom')
|
|
406
|
+
done()
|
|
392
407
|
})
|
|
393
408
|
})
|
|
394
409
|
|
|
395
|
-
test('should throw error if callback specified and if ready errors', t => {
|
|
410
|
+
test('should throw error if callback specified and if ready errors', (t, done) => {
|
|
396
411
|
t.plan(2)
|
|
397
412
|
const fastify = Fastify()
|
|
398
413
|
const error = new Error('kaboom')
|
|
@@ -405,8 +420,9 @@ test('should throw error if callback specified and if ready errors', t => {
|
|
|
405
420
|
method: 'GET',
|
|
406
421
|
url: '/'
|
|
407
422
|
}, err => {
|
|
408
|
-
t.ok(err)
|
|
409
|
-
t.
|
|
423
|
+
t.assert.ok(err)
|
|
424
|
+
t.assert.strictEqual(err, error)
|
|
425
|
+
done()
|
|
410
426
|
})
|
|
411
427
|
})
|
|
412
428
|
|
|
@@ -421,9 +437,9 @@ test('should support builder-style injection with ready app', async (t) => {
|
|
|
421
437
|
|
|
422
438
|
await fastify.ready()
|
|
423
439
|
const res = await fastify.inject().get('/').end()
|
|
424
|
-
t.
|
|
425
|
-
t.
|
|
426
|
-
t.
|
|
440
|
+
t.assert.deepStrictEqual(payload, JSON.parse(res.payload))
|
|
441
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
442
|
+
t.assert.strictEqual(res.headers['content-length'], '17')
|
|
427
443
|
})
|
|
428
444
|
|
|
429
445
|
test('should support builder-style injection with non-ready app', async (t) => {
|
|
@@ -436,9 +452,9 @@ test('should support builder-style injection with non-ready app', async (t) => {
|
|
|
436
452
|
})
|
|
437
453
|
|
|
438
454
|
const res = await fastify.inject().get('/').end()
|
|
439
|
-
t.
|
|
440
|
-
t.
|
|
441
|
-
t.
|
|
455
|
+
t.assert.deepStrictEqual(payload, JSON.parse(res.payload))
|
|
456
|
+
t.assert.strictEqual(res.statusCode, 200)
|
|
457
|
+
t.assert.strictEqual(res.headers['content-length'], '17')
|
|
442
458
|
})
|
|
443
459
|
|
|
444
460
|
test('should handle errors in builder-style injection correctly', async (t) => {
|
|
@@ -451,19 +467,19 @@ test('should handle errors in builder-style injection correctly', async (t) => {
|
|
|
451
467
|
try {
|
|
452
468
|
await fastify.inject().get('/')
|
|
453
469
|
} catch (err) {
|
|
454
|
-
t.ok(err)
|
|
455
|
-
t.
|
|
470
|
+
t.assert.ok(err)
|
|
471
|
+
t.assert.strictEqual(err.message, 'Kaboom')
|
|
456
472
|
}
|
|
457
473
|
})
|
|
458
474
|
|
|
459
|
-
test('Should not throw on access to routeConfig frameworkErrors handler - FST_ERR_BAD_URL', t => {
|
|
475
|
+
test('Should not throw on access to routeConfig frameworkErrors handler - FST_ERR_BAD_URL', (t, done) => {
|
|
460
476
|
t.plan(5)
|
|
461
477
|
|
|
462
478
|
const fastify = Fastify({
|
|
463
479
|
frameworkErrors: function (err, req, res) {
|
|
464
|
-
t.ok(typeof req.id === 'string')
|
|
465
|
-
t.ok(req.raw instanceof Readable)
|
|
466
|
-
t.
|
|
480
|
+
t.assert.ok(typeof req.id === 'string')
|
|
481
|
+
t.assert.ok(req.raw instanceof Readable)
|
|
482
|
+
t.assert.deepStrictEqual(req.routeOptions.url, undefined)
|
|
467
483
|
res.send(`${err.message} - ${err.code}`)
|
|
468
484
|
}
|
|
469
485
|
})
|
|
@@ -478,8 +494,9 @@ test('Should not throw on access to routeConfig frameworkErrors handler - FST_ER
|
|
|
478
494
|
url: '/test/%world'
|
|
479
495
|
},
|
|
480
496
|
(err, res) => {
|
|
481
|
-
t.
|
|
482
|
-
t.
|
|
497
|
+
t.assert.ifError(err)
|
|
498
|
+
t.assert.strictEqual(res.body, '\'/test/%world\' is not a valid url component - FST_ERR_BAD_URL')
|
|
499
|
+
done()
|
|
483
500
|
}
|
|
484
501
|
)
|
|
485
502
|
})
|