Skip to content

Commit

Permalink
test: migrated twice-done.test.js from tap to node:test (#298)
Browse files Browse the repository at this point in the history
Co-authored-by: hanquliu <[email protected]>
  • Loading branch information
liuhanqu and hanquliu authored Jan 3, 2025
1 parent ff2ff05 commit 8bd7e10
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/twice-done.test.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
'use strict'

const { test } = require('tap')
const { test } = require('node:test')
const boot = require('..')

test('calling done twice does not throw error', (t) => {
test('calling done twice does not throw error', (t, testDone) => {
t.plan(2)

const app = boot()

app
.use(twiceDone)
.ready((err) => {
t.notOk(err, 'no error')
t.assert.ifError(err)
testDone()
})

function twiceDone (s, opts, done) {
done()
done()
t.pass('did not throw')
t.assert.ok('did not throw')
}
})

0 comments on commit 8bd7e10

Please sign in to comment.