Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 937afcc

Browse filesBrowse files
estrada9166targos
authored andcommitted
test: add test to doesNotThrow; validate if actual with regex
Refs: https://coverage.nodejs.org/coverage-1a4f27ae21698d0c/lib/assert.js.html#L736 PR-URL: #28355 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 004d26d commit 937afcc
Copy full SHA for 937afcc

File tree

Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-assert.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-assert.js
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,17 @@ assert.throws(
178178
}
179179
);
180180

181+
assert.throws(
182+
() => a.doesNotThrow(() => thrower(Error), /\[[a-z]{6}\s[A-z]{6}\]/g, 'user message'),
183+
{
184+
name: 'AssertionError',
185+
code: 'ERR_ASSERTION',
186+
operator: 'doesNotThrow',
187+
message: 'Got unwanted exception: user message\n' +
188+
'Actual message: "[object Object]"'
189+
}
190+
);
191+
181192
// Make sure that validating using constructor really works.
182193
{
183194
let threw = false;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.