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

Commit 107e80d

Browse files
vicbmhevery
authored andcommitted
refactor(specs): main() does not return a value (void)
closes #627
1 parent b77534e commit 107e80d

34 files changed

+6100
-6047
lines changed

perf/dom/compile_perf.dart

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
import '_perf.dart';
22

3-
main() => describe('compiler', () {
4-
describe('block instantiation', () {
5-
it('time ', inject((TestBed tb) {
6-
tb.compile(UL_REPEATER);
7-
var items = [];
8-
for(var i = 0; i < 100; i++) {
9-
items.add({"text":'text_$i', "done": i & 1 == 1});
10-
}
11-
var empty = [];
12-
tb.rootScope.context['classFor'] = (item) => 'ng-${item["done"]}';
3+
void main() {
4+
describe('compiler', () {
5+
describe('block instantiation', () {
6+
it('time ', inject((TestBed tb) {
7+
tb.compile(UL_REPEATER);
8+
var items = [];
9+
for(var i = 0; i < 100; i++) {
10+
items.add({"text":'text_$i', "done": i & 1 == 1});
11+
}
12+
var empty = [];
13+
tb.rootScope.context['classFor'] = (item) => 'ng-${item["done"]}';
1314

14-
time('create 100 blocks',
15-
() => tb.rootScope.apply(() => tb.rootScope.context['items'] = items),
16-
cleanUp: () => tb.rootScope.apply(() => tb.rootScope.context['items'] = empty),
17-
verify: () => expect(tb.rootElement.querySelectorAll('li').length).toEqual(100));
18-
}));
15+
time('create 100 blocks',
16+
() => tb.rootScope.apply(() => tb.rootScope.context['items'] = items),
17+
cleanUp: () => tb.rootScope.apply(() => tb.rootScope.context['items'] = empty),
18+
verify: () => expect(tb.rootElement.querySelectorAll('li').length).toEqual(100));
19+
}));
20+
});
1921
});
20-
});
22+
}
2123

2224
var UL_REPEATER =
2325
"""

test/bootstrap_spec.dart

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,30 @@ library bootstrap_spec;
22

33
import '_specs.dart';
44

5-
main() => describe('bootstrap', () {
6-
BodyElement body = window.document.querySelector('body');
5+
void main() {
6+
describe('bootstrap', () {
7+
BodyElement body = window.document.querySelector('body');
78

8-
it('should default to whole page', () {
9-
body.innerHtml = '<div>{{"works"}}</div>';
10-
ngBootstrap();
11-
expect(body.innerHtml).toEqual('<div>works</div>');
12-
});
9+
it('should default to whole page', () {
10+
body.innerHtml = '<div>{{"works"}}</div>';
11+
ngBootstrap();
12+
expect(body.innerHtml).toEqual('<div>works</div>');
13+
});
1314

14-
it('should compile starting at ng-app node', () {
15-
body.setInnerHtml(
16-
'<div>{{ignor me}}<div ng-app ng-bind="\'works\'"></div></div>',
17-
treeSanitizer: new NullTreeSanitizer());
18-
ngBootstrap();
19-
expect(body.text).toEqual('{{ignor me}}works');
20-
});
15+
it('should compile starting at ng-app node', () {
16+
body.setInnerHtml(
17+
'<div>{{ignor me}}<div ng-app ng-bind="\'works\'"></div></div>',
18+
treeSanitizer: new NullTreeSanitizer());
19+
ngBootstrap();
20+
expect(body.text).toEqual('{{ignor me}}works');
21+
});
2122

22-
it('should compile starting at ng-app node', () {
23-
body.setInnerHtml(
24-
'<div>{{ignor me}}<div ng-bind="\'works\'"></div></div>',
25-
treeSanitizer: new NullTreeSanitizer());
26-
ngBootstrap(element:body.querySelector('div[ng-bind]'));
27-
expect(body.text).toEqual('{{ignor me}}works');
23+
it('should compile starting at ng-app node', () {
24+
body.setInnerHtml(
25+
'<div>{{ignor me}}<div ng-bind="\'works\'"></div></div>',
26+
treeSanitizer: new NullTreeSanitizer());
27+
ngBootstrap(element:body.querySelector('div[ng-bind]'));
28+
expect(body.text).toEqual('{{ignor me}}works');
29+
});
2830
});
29-
});
31+
}

0 commit comments

Comments
 (0)