test_runner: reimplement assert.ok to allow stack parsing

PR-URL: https://github.com/nodejs/node/pull/54776
Refs: https://github.com/nodejs/help/issues/4461
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Aviv Keller authored and RafaelGSS committed 2024-09-17 11:18:27 -03:00
1 parent 67b1d4cb45
commit de0f445a7f
4 files changed
+303 -269

No files matched your search

+4
View File
@@ -24,3 +24,7 @@ test('only methods from node:assert are on t.assert', (t) => {
'throws',
]);
});
test('t.assert.ok correctly parses the stacktrace', (t) => {
t.assert.throws(() => t.assert.ok(1 === 2), /t\.assert\.ok\(1 === 2\)/);
});