Files
node/test/parallel/test-assert-fail.js
T
Ruben Bridgewater 73416b46e4 assert: refactor the code
1. Rename private functions
2. Use destructuring
3. Remove obsolete comments

Backport-PR-URL: https://github.com/nodejs/node/pull/15516
PR-URL: https://github.com/nodejs/node/pull/13862
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-09-25 23:42:31 -04:00

11 lines
257 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
// The stackFrameFunction should exclude the foo frame
assert.throws(
function foo() { assert.fail('first', 'second', 'message', '!==', foo); },
(err) => !/foo/m.test(err.stack)
);