Skip to content

Commit c078056

Browse files
crisbetodylhunn
authored andcommitted
test(core): clean up unnecessary nesting in old tests (angular#52239)
A lot of our tests are wrapped in `{}` which serves no purpose, aside from increasing the nesting level and, in some cases, causing confusion. The braces appear to be a leftover from a time when all tests were wrapped in a `function main() {}`. The function declaration was removed in angular#21053, but the braces remained, presumably because it was easier to search&replace for `function main()`, but not to remove the braces at the same time. PR Close angular#52239
1 parent cfd89b0 commit c078056

File tree

114 files changed

+27740
-28137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+27740
-28137
lines changed

packages/animations/browser/test/dsl/animation_ast_builder_spec.ts

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,53 @@ import {AnimationMetadata, AnimationMetadataType} from '@angular/animations';
1010
import {buildAnimationAst} from '../../src/dsl/animation_ast_builder';
1111
import {MockAnimationDriver} from '../../testing';
1212

13-
{
14-
describe('buildAnimationAst', () => {
15-
it('should build the AST without any errors and warnings', () => {
16-
const driver = new MockAnimationDriver();
17-
const errors: Error[] = [];
18-
const warnings: string[] = [];
19-
const animationAst = buildAnimationAst(
20-
driver, <AnimationMetadata>{
21-
animation: [{
22-
styles: {
23-
offset: null,
24-
styles: {backgroundColor: '#000'},
25-
type: AnimationMetadataType.Style
26-
},
27-
timings: {delay: 0, duration: 1000, easing: 'ease-in-out'},
28-
type: AnimationMetadataType.Animate
29-
}],
30-
options: null,
31-
selector: 'body',
32-
type: AnimationMetadataType.Query
33-
},
34-
errors, warnings);
3513

36-
expect(errors).toEqual([]);
37-
expect(warnings).toEqual([]);
38-
expect(animationAst).toEqual(<ReturnType<typeof buildAnimationAst>>{
39-
type: 11,
40-
selector: 'body',
41-
limit: 0,
42-
optional: false,
43-
includeSelf: false,
44-
animation: {
45-
type: 4,
46-
timings: {delay: 0, duration: 1000, easing: 'ease-in-out'},
47-
style: {
48-
type: 6,
49-
styles: [new Map([['backgroundColor', '#000']])],
50-
easing: null,
51-
offset: null,
52-
containsDynamicStyles: false,
53-
options: null,
54-
isEmptyStep: false
55-
},
56-
options: null
14+
describe('buildAnimationAst', () => {
15+
it('should build the AST without any errors and warnings', () => {
16+
const driver = new MockAnimationDriver();
17+
const errors: Error[] = [];
18+
const warnings: string[] = [];
19+
const animationAst = buildAnimationAst(
20+
driver, <AnimationMetadata>{
21+
animation: [{
22+
styles: {
23+
offset: null,
24+
styles: {backgroundColor: '#000'},
25+
type: AnimationMetadataType.Style
26+
},
27+
timings: {delay: 0, duration: 1000, easing: 'ease-in-out'},
28+
type: AnimationMetadataType.Animate
29+
}],
30+
options: null,
31+
selector: 'body',
32+
type: AnimationMetadataType.Query
5733
},
58-
originalSelector: 'body',
59-
options: {}
60-
});
34+
errors, warnings);
35+
36+
expect(errors).toEqual([]);
37+
expect(warnings).toEqual([]);
38+
expect(animationAst).toEqual(<ReturnType<typeof buildAnimationAst>>{
39+
type: 11,
40+
selector: 'body',
41+
limit: 0,
42+
optional: false,
43+
includeSelf: false,
44+
animation: {
45+
type: 4,
46+
timings: {delay: 0, duration: 1000, easing: 'ease-in-out'},
47+
style: {
48+
type: 6,
49+
styles: [new Map([['backgroundColor', '#000']])],
50+
easing: null,
51+
offset: null,
52+
containsDynamicStyles: false,
53+
options: null,
54+
isEmptyStep: false
55+
},
56+
options: null
57+
},
58+
originalSelector: 'body',
59+
options: {}
6160
});
6261
});
63-
}
62+
});

0 commit comments

Comments
 (0)