Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Fix problem with Jasmine and afterEach #770

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions test/core_dom/event_handler_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ main() {
module..value(Element, document.body);
});

// Not sure why this doesn't work.
afterEach(() {
document.body.children.clear();
});
Expand All @@ -45,7 +44,6 @@ main() {
document.querySelector('[on-abc]').dispatchEvent(new Event('abc'));
var fooScope = _.getScope(document.querySelector('[foo]'));
expect(fooScope.context['ctrl'].invoked).toEqual(true);
document.body.children.clear();
}));

it('shoud register and handle event with long name', inject((TestBed _) {
Expand All @@ -57,7 +55,6 @@ main() {
document.querySelector('[on-my-new-event]').dispatchEvent(new Event('myNewEvent'));
var fooScope = _.getScope(document.querySelector('[foo]'));
expect(fooScope.context['ctrl'].invoked).toEqual(true);
document.body.children.clear();
}));

it('shoud have model updates applied correctly', inject((TestBed _) {
Expand All @@ -69,7 +66,6 @@ main() {
el.dispatchEvent(new Event('abc'));
_.rootScope.apply();
expect(el.text).toEqual("new description");
document.body.children.clear();
}));

it('shoud register event when shadow dom is used', async((TestBed _) {
Expand All @@ -82,7 +78,6 @@ main() {
span.dispatchEvent(new CustomEvent('abc'));
var ctrl = _.rootScope.context['ctrl'];
expect(ctrl.invoked).toEqual(true);
document.body.children.clear();
}));

it('shoud handle event within content only once', async(inject((TestBed _) {
Expand All @@ -102,7 +97,6 @@ main() {

var fooScope = _.getScope(document.querySelector('[foo]'));
expect(fooScope.context['ctrl'].invoked).toEqual(true);
document.body.children.clear();
})));
});
}
3 changes: 1 addition & 2 deletions test/jasmine_syntax.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ describe(name, fn, [bool exclusive=false]) {
try {
unit.group(name, () {
unit.setUp(currentDescribe.setUp);
fn();

unit.tearDown(currentDescribe.tearDown);
fn();
});
} finally {
currentDescribe = lastDescribe;
Expand Down