(done)
| 33 | }) |
| 34 | |
| 35 | function checkId (done) { |
| 36 | fastify.inject({ |
| 37 | method: 'GET', |
| 38 | url: 'http://localhost:' + fastify.server.address().port |
| 39 | }, (err, res) => { |
| 40 | t.assert.ifError(err) |
| 41 | const payload = JSON.parse(res.payload) |
| 42 | t.assert.ok(ids.indexOf(payload.id) === -1, 'the id should not be duplicated') |
| 43 | ids.push(payload.id) |
| 44 | done() |
| 45 | }) |
| 46 | } |
| 47 | }) |
| 48 | |
| 49 | test('The logger should not reuse request id header for req.id', (t, done) => { |