Skip to content

Commit 8f55a8c

Browse files
committed
refactor(test): use zone.js's mocha-patch
1 parent 9b6f9f7 commit 8f55a8c

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

Diff for: templates/app/spec.js

+3-13
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import 'babel-polyfill';
55
import 'zone.js/dist/zone';
66
import 'zone.js/dist/long-stack-trace-zone';
77
import 'zone.js/dist/proxy';
8-
import 'zone.js/dist/sync-test';
9-
<%_ if (filters.jasmine) { -%>
10-
import 'zone.js/dist/jasmine-patch';
11-
<%_ } -%>
8+
import 'zone.js/dist/sync-test';<%_ if (filters.jasmine) { %>
9+
import 'zone.js/dist/jasmine-patch';<% } %><%_ if (filters.mocha) { %>
10+
import 'zone.js/dist/mocha-patch';<% } %>
1211
import 'zone.js/dist/async-test';
1312
import 'zone.js/dist/fake-async-test';
1413

@@ -28,12 +27,3 @@ import {
2827

2928
TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
3029

31-
<%_ if (filters.mocha) { -%>
32-
var hook = new Mocha.Hook('Modified Angular beforeEach Hook', function() {
33-
getTestBed().resetTestingModule();
34-
});
35-
36-
hook.ctx = mocha.suite.ctx;
37-
hook.parent = mocha.suite;
38-
mocha.suite._beforeEach = [hook];
39-
<%_ } -%>

0 commit comments

Comments
 (0)