Skip to content

Commit a5eb04c

Browse files
test: add assertion for Assert constructor requiring new
1 parent 231f0c9 commit a5eb04c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/parallel/test-assert-class.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ if (process.stdout.isTTY) {
1313
process.env.NODE_DISABLE_COLORS = '1';
1414
}
1515

16+
test('Assert constructor requires new', () => {
17+
assert.throws(
18+
() => Assert(),
19+
{
20+
code: 'ERR_INVALID_ARG_TYPE',
21+
name: 'TypeError',
22+
message: /Assert/,
23+
}
24+
);
25+
});
26+
1627
test('Assert class basic instance', () => {
1728
const assertInstance = new Assert();
1829

0 commit comments

Comments
 (0)