mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

PR-URL: https://github.com/nodejs/node/pull/58253 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
20 lines
637 B
JavaScript
20 lines
637 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('node:assert');
|
|
const test = require('node:test');
|
|
|
|
test('expected methods are on t.assert', (t) => {
|
|
const uncopiedKeys = [
|
|
'AssertionError',
|
|
'strict',
|
|
'Assert',
|
|
'options',
|
|
];
|
|
const assertKeys = Object.keys(assert).filter((key) => !uncopiedKeys.includes(key));
|
|
const expectedKeys = ['snapshot', 'fileSnapshot'].concat(assertKeys).sort();
|
|
assert.deepStrictEqual(Object.keys(t.assert).sort(), expectedKeys);
|
|
});
|
|
|
|
test('t.assert.ok correctly parses the stacktrace', (t) => {
|
|
t.assert.throws(() => t.assert.ok(1 === 2), /t\.assert\.ok\(1 === 2\)/);
|
|
});
|