Skip to content

Commit

Permalink
wtf Edge
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Garrett committed Aug 14, 2019
1 parent 546c308 commit fca3e98
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/internal-test-helpers/lib/ember-dev/assertion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const BREAK = {};
disrupt the control flow.
*/
export function setupAssertionHelpers(hooks: NestedHooks, env: DebugEnv) {
let originalAssertFunc = env.getDebugFunction('assert');

hooks.beforeEach(function(assert) {
let expectAssertion: ExpectAssertionFunc = (func: () => void, expectedMessage: Message) => {
if (!DEBUG) {
Expand Down Expand Up @@ -70,6 +72,10 @@ export function setupAssertionHelpers(hooks: NestedHooks, env: DebugEnv) {
});

hooks.afterEach(function() {
// Edge will occasionally not run finally blocks, so we have to be extra
// sure we restore the original assert function
env.setDebugFunction('assert', originalAssertFunc);

window.expectAssertion = null;
window.ignoreAssertion = null;
});
Expand Down

0 comments on commit fca3e98

Please sign in to comment.