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

Commit a599986

Browse files
committed
feat(event_spec): Add aaddTest to run an event test in an iit
1 parent 479ef4d commit a599986

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

test/directive/ng_events_spec.dart

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ library ng_events_spec;
33
import '../_specs.dart';
44
import 'dart:html' as dom;
55

6-
void addTest(String name, [String eventType='MouseEvent', String eventName]) {
6+
void addTest(String name, [String eventType='MouseEvent', String eventName, exclusive=false]) {
77
if (eventName == null) {
88
eventName = name;
99
}
1010

11-
describe('ng-$name', () {
11+
var describeBody = () {
1212
TestBed _;
1313

1414
beforeEach((TestBed tb) => _ = tb);
@@ -19,7 +19,17 @@ void addTest(String name, [String eventType='MouseEvent', String eventName]) {
1919
expect(_.rootScope.context['abc']).toEqual(true);
2020
expect(_.rootScope.context['event'] is dom.UIEvent).toEqual(true);
2121
});
22-
});
22+
};
23+
24+
if (exclusive) {
25+
ddescribe('ng-$name', describeBody);
26+
} else {
27+
describe('ng-$name', describeBody);
28+
}
29+
}
30+
31+
void aaddTest(String name, [String eventType='MouseEvent', String eventName]) {
32+
addTest(name, eventType, eventName, true);
2333
}
2434

2535
main() {

0 commit comments

Comments
 (0)