Skip to content

Commit cb0d230

Browse files
authored
Overwrite assert.isFalse (microsoft#19506)
1 parent 127f6f8 commit cb0d230

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/harness/harness.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
// this will work in the browser via browserify
3333
var _chai: typeof chai = require("chai");
3434
var assert: typeof _chai.assert = _chai.assert;
35+
// chai's builtin `assert.isFalse` is featureful but slow - we don't use those features,
36+
// so we'll just overwrite it as an alterative to migrating a bunch of code off of chai
37+
assert.isFalse = (expr, msg) => { if (expr as any as boolean !== false) throw new Error(msg); };
3538
declare var __dirname: string; // Node-specific
3639
var global: NodeJS.Global = <any>Function("return this").call(undefined);
3740

0 commit comments

Comments
 (0)