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

Commit e762425

Browse files
committed
feat(ddescribe): added ddescribe support
1 parent a08a1cf commit e762425

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

test/directive_spec.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ExplicitNullTranscludeDirective {
1313
}
1414

1515
main() {
16-
describe('directive factory', () {
16+
d escribe('directive factory', () {
1717
it('should guess the directive name correctly', () {
1818
DirectiveFactory factory = new DirectiveFactory(SomeDirective);
1919
expect(factory.$name).toEqual('some');

test/jasmine_syntax.dart

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,27 @@ library jamine;
33
import 'package:unittest/unittest.dart';
44
import 'package:js/js.dart' as js;
55

6-
it(name, fn) => test(name, fn);
6+
it(name, fn) {
7+
if (currentDescribe.exclusive) {
8+
solo_test(name, fn);
9+
} else {
10+
test(name, fn);
11+
}
12+
}
713
iit(name, fn) => solo_test(name, fn);
814
xit(name, fn) {}
915
xdescribe(name, fn) {}
16+
ddescribe(name, fn) => describe(name, fn, true);
17+
1018

1119
class Describe {
1220
Describe parent;
1321
String name;
22+
bool exclusive;
1423
List<Function> beforeEachFns = [];
1524
List<Function> afterEachFns = [];
1625

17-
Describe(this.name, this.parent);
26+
Describe(this.name, this.parent, [bool this.exclusive=false]);
1827

1928
setUp() {
2029
if (parent != null) {
@@ -33,9 +42,9 @@ class Describe {
3342

3443
Describe currentDescribe = new Describe('', null);
3544

36-
describe(name, fn) {
45+
describe(name, fn, [bool exclusive=false]) {
3746
var lastDescribe = currentDescribe;
38-
currentDescribe = new Describe(name, lastDescribe);
47+
currentDescribe = new Describe(name, lastDescribe, exclusive);
3948
try {
4049
group(name, () {
4150
setUp(currentDescribe.setUp);

0 commit comments

Comments
 (0)