Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: migrated pretty-print.test.js from tap to node:test #297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, how did the test previousl worked?


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