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

Commit 6351681

Browse files
vicbmhevery
authored andcommitted
refactor(test): fix code style
1 parent 92ed26f commit 6351681

File tree

3 files changed

+38
-36
lines changed

3 files changed

+38
-36
lines changed

test/core/core_directive_spec.dart

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import '../_specs.dart';
55
main() => describe('DirectiveMap', () {
66

77
beforeEach(module((Module module) {
8-
module
9-
..type(AnnotatedIoComponent);
8+
module..type(AnnotatedIoComponent);
109
}));
1110

1211
it('should extract attr map from annotated component', inject((DirectiveMap directives) {
@@ -40,10 +39,10 @@ main() => describe('DirectiveMap', () {
4039
describe('exceptions', () {
4140
it('should throw when annotation is for existing mapping', () {
4241
var module = new Module()
43-
..type(DirectiveMap)
44-
..type(Bad1Component)
45-
..type(MetadataExtractor)
46-
..type(FieldMetadataExtractor);
42+
..type(DirectiveMap)
43+
..type(Bad1Component)
44+
..type(MetadataExtractor)
45+
..type(FieldMetadataExtractor);
4746

4847
var injector = new DynamicInjector(modules: [module]);
4948
expect(() {
@@ -54,10 +53,10 @@ main() => describe('DirectiveMap', () {
5453

5554
it('should throw when annotated both getter and setter', () {
5655
var module = new Module()
57-
..type(DirectiveMap)
58-
..type(Bad2Component)
59-
..type(MetadataExtractor)
60-
..type(FieldMetadataExtractor);
56+
..type(DirectiveMap)
57+
..type(Bad2Component)
58+
..type(MetadataExtractor)
59+
..type(FieldMetadataExtractor);
6160

6261
var injector = new DynamicInjector(modules: [module]);
6362
expect(() {
@@ -81,8 +80,7 @@ main() => describe('DirectiveMap', () {
8180
exportExpressions: const ['exportExpressions'],
8281
map: const {
8382
'foo': '=>foo'
84-
}
85-
)
83+
})
8684
class AnnotatedIoComponent {
8785
AnnotatedIoComponent(Scope scope) {
8886
scope.$root.ioComponent = this;
@@ -116,17 +114,15 @@ class AnnotatedIoComponent {
116114
template: r'<content></content>',
117115
map: const {
118116
'foo': '=>foo'
119-
}
120-
)
117+
})
121118
class Bad1Component {
122119
@NgOneWay('foo')
123120
String foo;
124121
}
125122

126123
@NgComponent(
127124
selector: 'bad2',
128-
template: r'<content></content>'
129-
)
125+
template: r'<content></content>')
130126
class Bad2Component {
131127
@NgOneWay('foo')
132128
get foo => null;

test/core/templateurl_spec.dart

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,17 @@ main() => describe('template url', () {
4747
describe('loading with http rewriting', () {
4848
beforeEach(module((Module module) {
4949
module
50-
..type(HtmlAndCssComponent)
51-
..type(UrlRewriter, implementedBy: PrefixedUrlRewriter);
50+
..type(HtmlAndCssComponent)
51+
..type(UrlRewriter, implementedBy: PrefixedUrlRewriter);
5252
}));
5353

5454
it('should use the UrlRewriter for both HTML and CSS URLs', async(inject((Http $http,
5555
Compiler $compile, Scope $rootScope, Logger log, Injector injector, NgZone zone,
5656
MockHttpBackend backend, DirectiveMap directives) {
5757

58-
backend.whenGET('PREFIX:simple.html').respond('<div log="SIMPLE">Simple!</div>');
59-
backend.whenGET('PREFIX:simple.css').respond('.hello{}');
58+
backend
59+
..whenGET('PREFIX:simple.html').respond('<div log="SIMPLE">Simple!</div>')
60+
..whenGET('PREFIX:simple.css').respond('.hello{}');
6061

6162
var element = $('<div><html-and-css log>ignore</html-and-css><div>');
6263
zone.run(() {
@@ -76,11 +77,12 @@ main() => describe('template url', () {
7677

7778
describe('async template loading', () {
7879
beforeEach(module((Module module) {
79-
module.type(LogAttrDirective);
80-
module.type(SimpleUrlComponent);
81-
module.type(HtmlAndCssComponent);
82-
module.type(OnlyCssComponent);
83-
module.type(InlineWithCssComponent);
80+
module
81+
..type(LogAttrDirective)
82+
..type(SimpleUrlComponent)
83+
..type(HtmlAndCssComponent)
84+
..type(OnlyCssComponent)
85+
..type(InlineWithCssComponent);
8486
}));
8587

8688
it('should replace element with template from url', async(inject((Http $http,
@@ -124,8 +126,9 @@ main() => describe('template url', () {
124126
it('should load a CSS file into a style', async(inject((Http $http,
125127
Compiler $compile, Scope $rootScope, Logger log, Injector injector,
126128
MockHttpBackend backend, DirectiveMap directives) {
127-
backend.expectGET('simple.css').respond('.hello{}');
128-
backend.expectGET('simple.html').respond('<div log="SIMPLE">Simple!</div>');
129+
backend
130+
..expectGET('simple.css').respond('.hello{}')
131+
..expectGET('simple.html').respond('<div log="SIMPLE">Simple!</div>');
129132

130133
var element = $('<div><html-and-css log>ignore</html-and-css><div>');
131134
$compile(element, directives)(injector, element);
@@ -169,8 +172,9 @@ main() => describe('template url', () {
169172
it('should load the CSS before the template is loaded', async(inject((Http $http,
170173
Compiler $compile, Scope $rootScope, Injector injector,
171174
MockHttpBackend backend, DirectiveMap directives) {
172-
backend.expectGET('simple.css').respond('.hello{}');
173-
backend.expectGET('simple.html').respond('<div>Simple!</div>');
175+
backend
176+
..expectGET('simple.css').respond('.hello{}')
177+
..expectGET('simple.html').respond('<div>Simple!</div>');
174178

175179
var element = $('<html-and-css>ignore</html-and-css>');
176180
$compile(element, directives)(injector, element);
@@ -183,16 +187,18 @@ main() => describe('template url', () {
183187

184188
describe('multiple css loading', () {
185189
beforeEach(module((Module module) {
186-
module.type(LogAttrDirective);
187-
module.type(HtmlAndMultipleCssComponent);
190+
module
191+
..type(LogAttrDirective)
192+
..type(HtmlAndMultipleCssComponent);
188193
}));
189194

190195
it('should load multiple CSS files into a style', async(inject((Http $http,
191196
Compiler $compile, Scope $rootScope, Logger log, Injector injector,
192197
MockHttpBackend backend, DirectiveMap directives) {
193-
backend.expectGET('simple.css').respond('.hello{}');
194-
backend.expectGET('another.css').respond('.world{}');
195-
backend.expectGET('simple.html').respond('<div log="SIMPLE">Simple!</div>');
198+
backend
199+
..expectGET('simple.css').respond('.hello{}')
200+
..expectGET('another.css').respond('.world{}')
201+
..expectGET('simple.html').respond('<div log="SIMPLE">Simple!</div>');
196202

197203
var element = $('<div><html-and-css log>ignore</html-and-css><div>');
198204
$compile(element, directives)(injector, element);

test/core_dom/ng_mustache_spec.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ main() {
5252
}));
5353

5454

55-
it('should allow newlines in attribute', inject((Compiler $compile, Scope $rootScope, Injector injector) {
55+
it('should allow newlines in attribute', inject((Compiler $compile, Scope $rootScope, Injector injector, DirectiveMap directives) {
5656
var element = $('<div multiline-attr="line1: {{line1}}\nline2: {{line2}}"></div>');
57-
var template = $compile(element);
57+
var template = $compile(element, directives);
5858

5959
$rootScope.line1 = 'L1';
6060
$rootScope.line2 = 'L2';

0 commit comments

Comments
 (0)