diff --git a/test/parallel/test-assert-fail.js b/test/parallel/test-assert-fail.js index 12cff99e66c88d..efa48cc215cfdb 100644 --- a/test/parallel/test-assert-fail.js +++ b/test/parallel/test-assert-fail.js @@ -67,5 +67,5 @@ common.expectsError(() => { // The stackFrameFunction should exclude the foo frame assert.throws( function foo() { assert.fail('first', 'second', 'message', '!==', foo); }, - (err) => !/foo/m.test(err.stack) + (err) => !/^\s*at\sfoo\b/m.test(err.stack) );