refactor(lint): Don't allow console.log

Enable tslint check for `console.log` as a follow-up to
https://github.com/angular/angular/issues/13018
This commit is contained in:
Bowen Ni
2016-11-22 13:29:53 -08:00
committed by vsavkin
parent 6c2d931744
commit 2c02d34c05
32 changed files with 38 additions and 31 deletions

View File

@ -41,7 +41,7 @@ export function main() {
it('should throw an uncaught error', fakeAsync(() => {
const resolveSpy = jasmine.createSpy('resolveSpy');
spyOn(console, 'log');
spyOn(console, 'error');
expect(() => {
adapter.bootstrap(html('<ng2></ng2>'), ['ng1']).ready(resolveSpy);
@ -50,14 +50,14 @@ export function main() {
expect(resolveSpy).not.toHaveBeenCalled();
}));
it('should properly log to the console and re-throw', fakeAsync(() => {
spyOn(console, 'log');
it('should output an error message to the console and re-throw', fakeAsync(() => {
spyOn(console, 'error');
expect(() => {
adapter.bootstrap(html('<ng2></ng2>'), ['ng1']);
flushMicrotasks();
}).toThrowError();
expect(console.log).toHaveBeenCalled();
expect(console.log).toHaveBeenCalledWith(jasmine.any(Error), jasmine.any(String));
expect(console.error).toHaveBeenCalled();
expect(console.error).toHaveBeenCalledWith(jasmine.any(Error), jasmine.any(String));
}));
});