Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@types/diff": "^3.2.2",
"@types/fs-extra": "4.0.2",
"@types/hammerjs": "2.0.35",
"@types/jasmine": "2.2.22-alpha",
"@types/jasmine": "^2.8.8",
"@types/minimist": "^1.2.0",
"@types/node": "6.0.88",
"@types/selenium-webdriver": "3.0.7",
Expand Down Expand Up @@ -84,8 +84,8 @@
"hammerjs": "2.0.8",
"husky": "^0.14.3",
"incremental-dom": "0.4.1",
"jasmine": "2.4.1",
"jasmine-core": "2.4.1",
"jasmine": "3.1",
"jasmine-core": "3.1",
"jpm": "1.3.1",
"karma": "0.13.20",
"karma-browserstack-launcher": "0.1.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/bazel/test/ngc-wrapped/index_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('ngc_wrapped', () => {
`);

// expect no error
expect(runOneBuild()).toBe(true);
expect(runOneBuild()).toBe(true as any);

shouldExist('bazel-bin/some_project/index.js');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('expression diagnostics', () => {
const diagnostics = getTemplateExpressionDiagnostics(info);
if (diagnostics && diagnostics.length) {
const messages = diagnostics.map(d => d.message).join('\n ');
expect(messages).toContain(expected);
expect(messages).toContain(expected as any);
} else {
throw new Error(`Expected an error containing "${expected} in template "${template}"`);
}
Expand Down
10 changes: 5 additions & 5 deletions packages/compiler-cli/test/metadata/collector_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ describe('Collector', () => {
expect(casesAny).toBeTruthy();
const ctorData = casesAny.members !['__ctor__'];
expect(ctorData).toEqual(
[{__symbolic: 'constructor', parameters: [{__symbolic: 'reference', name: 'any'}]}]);
[{__symbolic: 'constructor', parameters: [{__symbolic: 'reference', name: 'any'}]}] as any);
});

it('should record annotations on set and get declarations', () => {
const propertyData = (line: number) => ({
const propertyData = (line: number): any => ({
name: [{
__symbolic: 'property',
decorators: [{
Expand Down Expand Up @@ -318,7 +318,7 @@ describe('Collector', () => {
}]
}]
}
});
} as any);
});

it('should report errors for destructured imports', () => {
Expand Down Expand Up @@ -764,7 +764,7 @@ describe('Collector', () => {
}]],
parameters: [{__symbolic: 'reference', name: 'any'}]
}]
});
} as any);
});

describe('with interpolations', () => {
Expand Down Expand Up @@ -868,7 +868,7 @@ describe('Collector', () => {
{__symbolic: 'reference', module: './foo', name: 'Foo', line: 3, character: 24}
]
}]
});
} as any);
});

it('should treat exported class expressions as a class', () => {
Expand Down
4 changes: 3 additions & 1 deletion packages/compiler-cli/test/ngc_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,9 @@ describe('ngc transformer command-line', () => {
const exitCode =
main(['-p', path.join(basePath, 'src/tsconfig.json')], message => messages.push(message));
expect(exitCode).toBe(1, 'Compile was expected to fail');
expect(messages[0]).toContain(['Tagged template expressions are not supported in metadata']);
expect(messages[0]).toContain([
'Tagged template expressions are not supported in metadata'
] as any);
});

// Regression: #20076
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ describe('TypeScriptNodeEmitter', () => {
originalColumn: 26,
name: null
}
]);
] as any);
});

it('should produce a mapping per range instead of a mapping per node', () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/compiler-cli/test/transformers/program_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ describe('ng program', () => {
program.emit();
const factory =
fs.readFileSync(path.resolve(testSupport.basePath, 'built/src/main.ngfactory.js'));
expect(factory).toContain('Hello world!');
expect(factory).toContain('Hello world!' as any);
done();
});
});
Expand Down Expand Up @@ -679,7 +679,7 @@ describe('ng program', () => {

const lazyNgFactory =
fs.readFileSync(path.resolve(testSupport.basePath, 'built/src/lazy/lazy.ngfactory.js'));
expect(lazyNgFactory).toContain('import * as i1 from "./lazy";');
expect(lazyNgFactory).toContain('import * as i1 from "./lazy";' as any);
});

it('should list lazyRoutes given an entryRoute recursively', () => {
Expand Down Expand Up @@ -739,7 +739,7 @@ describe('ng program', () => {
{name: undefined, filePath: path.resolve(testSupport.basePath, 'src/child.ts')},
route: './child'
},
]);
] as any);
});

it('should list lazyRoutes from imported modules', () => {
Expand Down
141 changes: 75 additions & 66 deletions packages/compiler/test/core_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,83 +103,92 @@ import * as core from '@angular/core';
});

it('const enums should be equal', () => {
expect(compilerCore.NodeFlags.None).toBe(core.ɵNodeFlags.None);
expect(compilerCore.NodeFlags.TypeElement).toBe(core.ɵNodeFlags.TypeElement);
expect(compilerCore.NodeFlags.TypeText).toBe(core.ɵNodeFlags.TypeText);
expect(compilerCore.NodeFlags.ProjectedTemplate).toBe(core.ɵNodeFlags.ProjectedTemplate);
expect(compilerCore.NodeFlags.CatRenderNode).toBe(core.ɵNodeFlags.CatRenderNode);
expect(compilerCore.NodeFlags.TypeNgContent).toBe(core.ɵNodeFlags.TypeNgContent);
expect(compilerCore.NodeFlags.TypePipe).toBe(core.ɵNodeFlags.TypePipe);
expect(compilerCore.NodeFlags.TypePureArray).toBe(core.ɵNodeFlags.TypePureArray);
expect(compilerCore.NodeFlags.TypePureObject).toBe(core.ɵNodeFlags.TypePureObject);
expect(compilerCore.NodeFlags.TypePurePipe).toBe(core.ɵNodeFlags.TypePurePipe);
expect(compilerCore.NodeFlags.CatPureExpression).toBe(core.ɵNodeFlags.CatPureExpression);
expect(compilerCore.NodeFlags.TypeValueProvider).toBe(core.ɵNodeFlags.TypeValueProvider);
expect(compilerCore.NodeFlags.TypeClassProvider).toBe(core.ɵNodeFlags.TypeClassProvider);
expect(compilerCore.NodeFlags.TypeFactoryProvider).toBe(core.ɵNodeFlags.TypeFactoryProvider);
expect(compilerCore.NodeFlags.None).toBe(core.ɵNodeFlags.None as any);
expect(compilerCore.NodeFlags.TypeElement).toBe(core.ɵNodeFlags.TypeElement as any);
expect(compilerCore.NodeFlags.TypeText).toBe(core.ɵNodeFlags.TypeText as any);
expect(compilerCore.NodeFlags.ProjectedTemplate)
.toBe(core.ɵNodeFlags.ProjectedTemplate as any);
expect(compilerCore.NodeFlags.CatRenderNode).toBe(core.ɵNodeFlags.CatRenderNode as any);
expect(compilerCore.NodeFlags.TypeNgContent).toBe(core.ɵNodeFlags.TypeNgContent as any);
expect(compilerCore.NodeFlags.TypePipe).toBe(core.ɵNodeFlags.TypePipe as any);
expect(compilerCore.NodeFlags.TypePureArray).toBe(core.ɵNodeFlags.TypePureArray as any);
expect(compilerCore.NodeFlags.TypePureObject).toBe(core.ɵNodeFlags.TypePureObject as any);
expect(compilerCore.NodeFlags.TypePurePipe).toBe(core.ɵNodeFlags.TypePurePipe as any);
expect(compilerCore.NodeFlags.CatPureExpression)
.toBe(core.ɵNodeFlags.CatPureExpression as any);
expect(compilerCore.NodeFlags.TypeValueProvider)
.toBe(core.ɵNodeFlags.TypeValueProvider as any);
expect(compilerCore.NodeFlags.TypeClassProvider)
.toBe(core.ɵNodeFlags.TypeClassProvider as any);
expect(compilerCore.NodeFlags.TypeFactoryProvider)
.toBe(core.ɵNodeFlags.TypeFactoryProvider as any);
expect(compilerCore.NodeFlags.TypeUseExistingProvider)
.toBe(core.ɵNodeFlags.TypeUseExistingProvider);
expect(compilerCore.NodeFlags.LazyProvider).toBe(core.ɵNodeFlags.LazyProvider);
expect(compilerCore.NodeFlags.PrivateProvider).toBe(core.ɵNodeFlags.PrivateProvider);
expect(compilerCore.NodeFlags.TypeDirective).toBe(core.ɵNodeFlags.TypeDirective);
expect(compilerCore.NodeFlags.Component).toBe(core.ɵNodeFlags.Component);
.toBe(core.ɵNodeFlags.TypeUseExistingProvider as any);
expect(compilerCore.NodeFlags.LazyProvider).toBe(core.ɵNodeFlags.LazyProvider as any);
expect(compilerCore.NodeFlags.PrivateProvider).toBe(core.ɵNodeFlags.PrivateProvider as any);
expect(compilerCore.NodeFlags.TypeDirective).toBe(core.ɵNodeFlags.TypeDirective as any);
expect(compilerCore.NodeFlags.Component).toBe(core.ɵNodeFlags.Component as any);
expect(compilerCore.NodeFlags.CatProviderNoDirective)
.toBe(core.ɵNodeFlags.CatProviderNoDirective);
expect(compilerCore.NodeFlags.CatProvider).toBe(core.ɵNodeFlags.CatProvider);
expect(compilerCore.NodeFlags.OnInit).toBe(core.ɵNodeFlags.OnInit);
expect(compilerCore.NodeFlags.OnDestroy).toBe(core.ɵNodeFlags.OnDestroy);
expect(compilerCore.NodeFlags.DoCheck).toBe(core.ɵNodeFlags.DoCheck);
expect(compilerCore.NodeFlags.OnChanges).toBe(core.ɵNodeFlags.OnChanges);
expect(compilerCore.NodeFlags.AfterContentInit).toBe(core.ɵNodeFlags.AfterContentInit);
expect(compilerCore.NodeFlags.AfterContentChecked).toBe(core.ɵNodeFlags.AfterContentChecked);
expect(compilerCore.NodeFlags.AfterViewInit).toBe(core.ɵNodeFlags.AfterViewInit);
expect(compilerCore.NodeFlags.AfterViewChecked).toBe(core.ɵNodeFlags.AfterViewChecked);
expect(compilerCore.NodeFlags.EmbeddedViews).toBe(core.ɵNodeFlags.EmbeddedViews);
expect(compilerCore.NodeFlags.ComponentView).toBe(core.ɵNodeFlags.ComponentView);
expect(compilerCore.NodeFlags.TypeContentQuery).toBe(core.ɵNodeFlags.TypeContentQuery);
expect(compilerCore.NodeFlags.TypeViewQuery).toBe(core.ɵNodeFlags.TypeViewQuery);
expect(compilerCore.NodeFlags.StaticQuery).toBe(core.ɵNodeFlags.StaticQuery);
expect(compilerCore.NodeFlags.DynamicQuery).toBe(core.ɵNodeFlags.DynamicQuery);
expect(compilerCore.NodeFlags.CatQuery).toBe(core.ɵNodeFlags.CatQuery);
expect(compilerCore.NodeFlags.Types).toBe(core.ɵNodeFlags.Types);

expect(compilerCore.DepFlags.None).toBe(core.ɵDepFlags.None);
expect(compilerCore.DepFlags.SkipSelf).toBe(core.ɵDepFlags.SkipSelf);
expect(compilerCore.DepFlags.Optional).toBe(core.ɵDepFlags.Optional);
expect(compilerCore.DepFlags.Value).toBe(core.ɵDepFlags.Value);

expect(compilerCore.InjectFlags.Default).toBe(core.InjectFlags.Default);
expect(compilerCore.InjectFlags.SkipSelf).toBe(core.InjectFlags.SkipSelf);
expect(compilerCore.InjectFlags.Self).toBe(core.InjectFlags.Self);

expect(compilerCore.ArgumentType.Inline).toBe(core.ɵArgumentType.Inline);
expect(compilerCore.ArgumentType.Dynamic).toBe(core.ɵArgumentType.Dynamic);
.toBe(core.ɵNodeFlags.CatProviderNoDirective as any);
expect(compilerCore.NodeFlags.CatProvider).toBe(core.ɵNodeFlags.CatProvider as any);
expect(compilerCore.NodeFlags.OnInit).toBe(core.ɵNodeFlags.OnInit as any);
expect(compilerCore.NodeFlags.OnDestroy).toBe(core.ɵNodeFlags.OnDestroy as any);
expect(compilerCore.NodeFlags.DoCheck).toBe(core.ɵNodeFlags.DoCheck as any);
expect(compilerCore.NodeFlags.OnChanges).toBe(core.ɵNodeFlags.OnChanges as any);
expect(compilerCore.NodeFlags.AfterContentInit).toBe(core.ɵNodeFlags.AfterContentInit as any);
expect(compilerCore.NodeFlags.AfterContentChecked)
.toBe(core.ɵNodeFlags.AfterContentChecked as any);
expect(compilerCore.NodeFlags.AfterViewInit).toBe(core.ɵNodeFlags.AfterViewInit as any);
expect(compilerCore.NodeFlags.AfterViewChecked).toBe(core.ɵNodeFlags.AfterViewChecked as any);
expect(compilerCore.NodeFlags.EmbeddedViews).toBe(core.ɵNodeFlags.EmbeddedViews as any);
expect(compilerCore.NodeFlags.ComponentView).toBe(core.ɵNodeFlags.ComponentView as any);
expect(compilerCore.NodeFlags.TypeContentQuery).toBe(core.ɵNodeFlags.TypeContentQuery as any);
expect(compilerCore.NodeFlags.TypeViewQuery).toBe(core.ɵNodeFlags.TypeViewQuery as any);
expect(compilerCore.NodeFlags.StaticQuery).toBe(core.ɵNodeFlags.StaticQuery as any);
expect(compilerCore.NodeFlags.DynamicQuery).toBe(core.ɵNodeFlags.DynamicQuery as any);
expect(compilerCore.NodeFlags.CatQuery).toBe(core.ɵNodeFlags.CatQuery as any);
expect(compilerCore.NodeFlags.Types).toBe(core.ɵNodeFlags.Types as any);

expect(compilerCore.DepFlags.None).toBe(core.ɵDepFlags.None as any);
expect(compilerCore.DepFlags.SkipSelf).toBe(core.ɵDepFlags.SkipSelf as any);
expect(compilerCore.DepFlags.Optional).toBe(core.ɵDepFlags.Optional as any);
expect(compilerCore.DepFlags.Value).toBe(core.ɵDepFlags.Value as any);

expect(compilerCore.InjectFlags.Default).toBe(core.InjectFlags.Default as any);
expect(compilerCore.InjectFlags.SkipSelf).toBe(core.InjectFlags.SkipSelf as any);
expect(compilerCore.InjectFlags.Self).toBe(core.InjectFlags.Self as any);

expect(compilerCore.ArgumentType.Inline).toBe(core.ɵArgumentType.Inline as any);
expect(compilerCore.ArgumentType.Dynamic).toBe(core.ɵArgumentType.Dynamic as any);

expect(compilerCore.BindingFlags.TypeElementAttribute)
.toBe(core.ɵBindingFlags.TypeElementAttribute);
expect(compilerCore.BindingFlags.TypeElementClass).toBe(core.ɵBindingFlags.TypeElementClass);
expect(compilerCore.BindingFlags.TypeElementStyle).toBe(core.ɵBindingFlags.TypeElementStyle);
expect(compilerCore.BindingFlags.TypeProperty).toBe(core.ɵBindingFlags.TypeProperty);
.toBe(core.ɵBindingFlags.TypeElementAttribute as any);
expect(compilerCore.BindingFlags.TypeElementClass)
.toBe(core.ɵBindingFlags.TypeElementClass as any);
expect(compilerCore.BindingFlags.TypeElementStyle)
.toBe(core.ɵBindingFlags.TypeElementStyle as any);
expect(compilerCore.BindingFlags.TypeProperty).toBe(core.ɵBindingFlags.TypeProperty as any);
expect(compilerCore.BindingFlags.SyntheticProperty)
.toBe(core.ɵBindingFlags.SyntheticProperty);
.toBe(core.ɵBindingFlags.SyntheticProperty as any);
expect(compilerCore.BindingFlags.SyntheticHostProperty)
.toBe(core.ɵBindingFlags.SyntheticHostProperty);
.toBe(core.ɵBindingFlags.SyntheticHostProperty as any);
expect(compilerCore.BindingFlags.CatSyntheticProperty)
.toBe(core.ɵBindingFlags.CatSyntheticProperty);
expect(compilerCore.BindingFlags.Types).toBe(core.ɵBindingFlags.Types);
.toBe(core.ɵBindingFlags.CatSyntheticProperty as any);
expect(compilerCore.BindingFlags.Types).toBe(core.ɵBindingFlags.Types as any);

expect(compilerCore.QueryBindingType.First).toBe(core.ɵQueryBindingType.First);
expect(compilerCore.QueryBindingType.All).toBe(core.ɵQueryBindingType.All);
expect(compilerCore.QueryBindingType.First).toBe(core.ɵQueryBindingType.First as any);
expect(compilerCore.QueryBindingType.All).toBe(core.ɵQueryBindingType.All as any);

expect(compilerCore.QueryValueType.ElementRef).toBe(core.ɵQueryValueType.ElementRef);
expect(compilerCore.QueryValueType.RenderElement).toBe(core.ɵQueryValueType.RenderElement);
expect(compilerCore.QueryValueType.TemplateRef).toBe(core.ɵQueryValueType.TemplateRef);
expect(compilerCore.QueryValueType.ElementRef).toBe(core.ɵQueryValueType.ElementRef as any);
expect(compilerCore.QueryValueType.RenderElement)
.toBe(core.ɵQueryValueType.RenderElement as any);
expect(compilerCore.QueryValueType.TemplateRef).toBe(core.ɵQueryValueType.TemplateRef as any);
expect(compilerCore.QueryValueType.ViewContainerRef)
.toBe(core.ɵQueryValueType.ViewContainerRef);
expect(compilerCore.QueryValueType.Provider).toBe(core.ɵQueryValueType.Provider);
.toBe(core.ɵQueryValueType.ViewContainerRef as any);
expect(compilerCore.QueryValueType.Provider).toBe(core.ɵQueryValueType.Provider as any);

expect(compilerCore.ViewFlags.None).toBe(core.ɵViewFlags.None);
expect(compilerCore.ViewFlags.OnPush).toBe(core.ɵViewFlags.OnPush);
expect(compilerCore.ViewFlags.None).toBe(core.ɵViewFlags.None as any);
expect(compilerCore.ViewFlags.OnPush).toBe(core.ɵViewFlags.OnPush as any);
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/test/css_parser/css_lexer_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ import {CssLexer, CssLexerMode, CssToken, CssTokenType, cssScannerError, getRawM
capturedMessage = getRawMessage(e);
}

expect(capturedMessage).toEqual(null);
expect(capturedMessage).toEqual(null as any);
});
});

Expand Down
6 changes: 3 additions & 3 deletions packages/compiler/test/css_parser/css_visitor_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,21 @@ function _getCaptureAst(capture: any[], index = 0): CssAst {
expect(captures.length).toEqual(3);

const rule1 = <CssSelectorRuleAst>_getCaptureAst(captures, 0);
expect(rule1).toEqual(ast.rules[0]);
expect(rule1).toEqual(ast.rules[0] as any);

const firstSelector = rule1.selectors[0];
const firstSimpleSelector = firstSelector.selectorParts[0];
_assertTokens(firstSimpleSelector.tokens, ['.', 'rule1']);

const rule2 = <CssSelectorRuleAst>_getCaptureAst(captures, 1);
expect(rule2).toEqual(ast.rules[1]);
expect(rule2).toEqual(ast.rules[1] as any);

const secondSelector = rule2.selectors[0];
const secondSimpleSelector = secondSelector.selectorParts[0];
_assertTokens(secondSimpleSelector.tokens, ['.', 'rule2']);

const rule3 = <CssSelectorRuleAst>_getCaptureAst(captures, 2);
expect(rule3).toEqual((<CssMediaQueryRuleAst>ast.rules[2]).block.entries[0]);
expect(rule3).toEqual((<CssMediaQueryRuleAst>ast.rules[2]).block.entries[0] as any);

const thirdSelector = rule3.selectors[0];
const thirdSimpleSelector = thirdSelector.selectorParts[0];
Expand Down
Loading