Skip to content

Commit

Permalink
test: make test-runner-assert more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
avivkeller committed Sep 20, 2024
1 parent 8b8fc53 commit c774a09
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions test/parallel/test-runner-assert.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
'use strict';
require('../common');
const { deepStrictEqual } = require('node:assert');
const assert = require('node:assert');
const test = require('node:test');

const uncopiedKeys = [
'AssertionError',
'CallTracker',
'strict'

Check failure on line 9 in test/parallel/test-runner-assert.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Missing trailing comma
];
test('only methods from node:assert are on t.assert', (t) => {
deepStrictEqual(Object.keys(t.assert).sort(), [
'deepEqual',
'deepStrictEqual',
'doesNotMatch',
'doesNotReject',
'doesNotThrow',
'equal',
'fail',
'ifError',
'match',
'notDeepEqual',
'notDeepStrictEqual',
'notEqual',
'notStrictEqual',
'ok',
'rejects',
'strictEqual',
'throws',
]);
const expectedKeys = Object.keys(assert).filter(key => !uncopiedKeys.includes(key)).sort();

Check failure on line 12 in test/parallel/test-runner-assert.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Expected parentheses around arrow function argument
assert.deepStrictEqual(Object.keys(t.assert).sort(), expectedKeys);
});

test('t.assert.ok correctly parses the stacktrace', (t) => {
Expand Down

0 comments on commit c774a09

Please sign in to comment.