From cb0d230c98540679c27f3303161a768e132ee4e9 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 26 Oct 2017 15:43:51 -0700 Subject: [PATCH] Overwrite assert.isFalse (#19506) --- src/harness/harness.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/harness/harness.ts b/src/harness/harness.ts index b867ca77628..c6caeff0dd9 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -32,6 +32,9 @@ // this will work in the browser via browserify var _chai: typeof chai = require("chai"); var assert: typeof _chai.assert = _chai.assert; +// chai's builtin `assert.isFalse` is featureful but slow - we don't use those features, +// so we'll just overwrite it as an alterative to migrating a bunch of code off of chai +assert.isFalse = (expr, msg) => { if (expr as any as boolean !== false) throw new Error(msg); }; declare var __dirname: string; // Node-specific var global: NodeJS.Global = Function("return this").call(undefined);