Revert "fix(core): log error instead of warning for unknown properties and elements (#35798)" (#35845)

This reverts commit 00f3c58bb9.
Rolling back because it could be breaking e2e tests that assert that
there are no errors in the console after the assertions have run. We can
re-add this in v10.

PR Close #35845
This commit is contained in:
Andrew Scott
2020-03-03 14:58:53 -08:00
committed by atscott
parent 00f3c58bb9
commit d543b13e5c
7 changed files with 47 additions and 47 deletions

View File

@ -97,7 +97,7 @@ describe('NgModule', () => {
});
describe('schemas', () => {
onlyInIvy('Unknown property logs an error message instead of throwing')
onlyInIvy('Unknown property warning logged instead of throwing an error')
.it('should throw on unknown props if NO_ERRORS_SCHEMA is absent', () => {
@Component({
selector: 'my-comp',
@ -120,7 +120,7 @@ describe('NgModule', () => {
TestBed.configureTestingModule({imports: [MyModule]});
const spy = spyOn(console, 'error');
const spy = spyOn(console, 'warn');
const fixture = TestBed.createComponent(MyComp);
fixture.detectChanges();
expect(spy.calls.mostRecent().args[0])
@ -185,15 +185,15 @@ describe('NgModule', () => {
}).not.toThrow();
});
onlyInIvy('unknown element check logs an error message rather than throwing')
.it('should log an error about unknown element without CUSTOM_ELEMENTS_SCHEMA for element with dash in tag name',
onlyInIvy('unknown element check logs a warning rather than throwing')
.it('should warn about unknown element without CUSTOM_ELEMENTS_SCHEMA for element with dash in tag name',
() => {
@Component({template: `<custom-el></custom-el>`})
class MyComp {
}
const spy = spyOn(console, 'error');
const spy = spyOn(console, 'warn');
TestBed.configureTestingModule({declarations: [MyComp]});
const fixture = TestBed.createComponent(MyComp);
fixture.detectChanges();
@ -215,14 +215,14 @@ describe('NgModule', () => {
}).toThrowError(/'custom-el' is not a known element/);
});
onlyInIvy('unknown element check logs an error message rather than throwing')
.it('should log an error about unknown element without CUSTOM_ELEMENTS_SCHEMA for element without dash in tag name',
onlyInIvy('unknown element check logs a warning rather than throwing')
.it('should warn about unknown element without CUSTOM_ELEMENTS_SCHEMA for element without dash in tag name',
() => {
@Component({template: `<custom></custom>`})
class MyComp {
}
const spy = spyOn(console, 'error');
const spy = spyOn(console, 'warn');
TestBed.configureTestingModule({declarations: [MyComp]});
const fixture = TestBed.createComponent(MyComp);
fixture.detectChanges();
@ -245,8 +245,8 @@ describe('NgModule', () => {
});
onlyInIvy('test relies on Ivy-specific AOT format')
.it('should not log unknown element error for AOT-compiled components', () => {
const spy = spyOn(console, 'error');
.it('should not log unknown element warning for AOT-compiled components', () => {
const spy = spyOn(console, 'warn');
/*
* @Component({
@ -310,13 +310,13 @@ describe('NgModule', () => {
expect(spy).not.toHaveBeenCalled();
});
onlyInIvy('unknown element check logs an error message rather than throwing')
.it('should not log an error about unknown elements with CUSTOM_ELEMENTS_SCHEMA', () => {
onlyInIvy('unknown element check logs a warning rather than throwing')
.it('should not warn about unknown elements with CUSTOM_ELEMENTS_SCHEMA', () => {
@Component({template: `<custom-el></custom-el>`})
class MyComp {
}
const spy = spyOn(console, 'error');
const spy = spyOn(console, 'warn');
TestBed.configureTestingModule({
declarations: [MyComp],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
@ -344,13 +344,13 @@ describe('NgModule', () => {
}).not.toThrow();
});
onlyInIvy('unknown element check logs an error message rather than throwing')
.it('should not log an error about unknown elements with NO_ERRORS_SCHEMA', () => {
onlyInIvy('unknown element check logs a warning rather than throwing')
.it('should not warn about unknown elements with NO_ERRORS_SCHEMA', () => {
@Component({template: `<custom-el></custom-el>`})
class MyComp {
}
const spy = spyOn(console, 'error');
const spy = spyOn(console, 'warn');
TestBed.configureTestingModule({
declarations: [MyComp],
schemas: [NO_ERRORS_SCHEMA],
@ -378,8 +378,8 @@ describe('NgModule', () => {
}).not.toThrow();
});
onlyInIvy('unknown element check logs an error message rather than throwing')
.it('should not log an error about unknown elements if element matches a directive', () => {
onlyInIvy('unknown element check logs a warning rather than throwing')
.it('should not warn about unknown elements if element matches a directive', () => {
@Component({
selector: 'custom-el',
template: '',
@ -391,7 +391,7 @@ describe('NgModule', () => {
class MyComp {
}
const spy = spyOn(console, 'error');
const spy = spyOn(console, 'warn');
TestBed.configureTestingModule({declarations: [MyComp, CustomEl]});
const fixture = TestBed.createComponent(MyComp);
@ -420,8 +420,8 @@ describe('NgModule', () => {
}).not.toThrow();
});
onlyInIvy('unknown element check logs an error message rather than throwing')
.it('should not log an error for HTML elements inside an SVG foreignObject', () => {
onlyInIvy('unknown element check logs a warning rather than throwing')
.it('should not warn for HTML elements inside an SVG foreignObject', () => {
@Component({
template: `
<svg>
@ -438,7 +438,7 @@ describe('NgModule', () => {
class MyModule {
}
const spy = spyOn(console, 'error');
const spy = spyOn(console, 'warn');
TestBed.configureTestingModule({imports: [MyModule]});
const fixture = TestBed.createComponent(MyComp);