Skip to content

Commit

Permalink
test: reduce output of reqIdGenFactory.test.js (#5012)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Sep 1, 2023
1 parent 3aee2e7 commit af5e329
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/internals/reqIdGenFactory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ const { test } = require('tap')
const { reqIdGenFactory } = require('../../lib/reqIdGenFactory')

test('should create incremental ids deterministically', t => {
t.plan(9999)
t.plan(1)
const reqIdGen = reqIdGenFactory()

for (let i = 1; i < 1e4; ++i) {
t.equal(reqIdGen(), 'req-' + i.toString(36))
if (reqIdGen() !== 'req-' + i.toString(36)) {
t.fail()
break
}
}
t.pass()
})

test('should have prefix "req-"', t => {
Expand Down

0 comments on commit af5e329

Please sign in to comment.