Skip to content

Commit

Permalink
test: migrated pretty-print.test.js from tap to node:test
Browse files Browse the repository at this point in the history
  • Loading branch information
hanquliu committed Jan 3, 2025
1 parent 433468a commit 936d16f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/pretty-print.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict'

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

test('pretty print', t => {
test('pretty print', async (t) => {
t.plan(19)

const app = boot()
Expand Down Expand Up @@ -32,19 +32,21 @@ test('pretty print', t => {
/^ bound _after \d+ ms$/,
/^ duplicate \d+ ms$/,
/^ {2} duplicate \d+ ms$/,
''
/^$/
]

app.on('preReady', function show () {
const print = app.prettyPrint()
const lines = print.split('\n')

t.equal(lines.length, linesExpected.length)
t.assert.strictEqual(lines.length, linesExpected.length)
lines.forEach((l, i) => {
t.match(l, linesExpected[i])
t.assert.match(l, linesExpected[i])
})
})

await app.ready()

function first (s, opts, done) {
done()
}
Expand Down

0 comments on commit 936d16f

Please sign in to comment.