Skip to content

Commit

Permalink
fix(mocha): use global if window does not exist (angular#943)
Browse files Browse the repository at this point in the history
- `window` does not exist in NativeScript applications.
- this removes a hacky workaround where you assign `global.window` to `global` before including the mocha patch.
- preserve existing behavior by using window first if it exists.
  • Loading branch information
justindujardin authored and mhevery committed Dec 27, 2017
1 parent f0dc5b1 commit 3caf6fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mocha/mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@

})(Mocha.Runner.prototype.runTest, Mocha.Runner.prototype.run);

})(window);
})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);

0 comments on commit 3caf6fc

Please sign in to comment.