From 936d16f3f0ea770943cbecfb43e3c5b4e1568c2e Mon Sep 17 00:00:00 2001 From: hanquliu Date: Fri, 3 Jan 2025 18:20:28 +0800 Subject: [PATCH] test: migrated pretty-print.test.js from tap to node:test --- test/pretty-print.test.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/pretty-print.test.js b/test/pretty-print.test.js index 734ab08..ce2ed86 100644 --- a/test/pretty-print.test.js +++ b/test/pretty-print.test.js @@ -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() @@ -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() }