Skip to content

Commit

Permalink
Pipeline fix
Browse files Browse the repository at this point in the history
  • Loading branch information
validide committed Jun 18, 2020
1 parent cf617b7 commit d60165c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export abstract class Component {
* @param optionalParams Optional parameters.
*/
protected log(message?: any, ...optionalParams: any[]): void {
const logMethod = this.window?.console?.log;
const logMethod = (this.window as any)?.console?.log;
if (logMethod)
logMethod(message, optionalParams);
}
Expand Down
10 changes: 5 additions & 5 deletions test/core/component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export function test_Component() {
options.handlers.error = (e: ComponentEvent) => {
errHandlerCalled = true;
};
_win.console.log = (msg: any, ...opt: any[]) => {
(_win as any).console.log = (msg: any, ...opt: any[]) => {
err = (msg as Error);
};
const comp = new StubComponent(_win, options);
Expand Down Expand Up @@ -482,7 +482,7 @@ export function test_Component() {
throw err;
};
comp.throwError = true;
_win.console.log = (message?: any, ...optionalParams: any[]) => {
(_win as any).console.log = (message?: any, ...optionalParams: any[]) => {
consoleLog.push({ message: message, optionalParams: optionalParams });
};

Expand All @@ -499,7 +499,7 @@ export function test_Component() {
const comp = new StubComponent(_win, options);
options.handlers = options.handlers || new ComponentEventHandlers();
comp.throwError = true;
_win.console.log = (message?: any, ...optionalParams: any[]) => {
(_win as any).console.log = (message?: any, ...optionalParams: any[]) => {
consoleLog.push({ message: message, optionalParams: optionalParams });
};

Expand All @@ -516,7 +516,7 @@ export function test_Component() {
options.handlers = (undefined as unknown as ComponentEventHandlers);
const comp = new StubComponent(_win, options);
comp.throwError = true;
_win.console.log = (message?: any, ...optionalParams: any[]) => {
(_win as any).console.log = (message?: any, ...optionalParams: any[]) => {
consoleLog.push({ message: message, optionalParams: optionalParams });
};

Expand All @@ -530,7 +530,7 @@ export function test_Component() {
it('doe not fail in log method if "log" method is missing', async () => {
const comp = new StubComponent(_win, _options);
comp.throwError = true;
(_win.console as any).log = undefined;
((_win as any).console as any).log = undefined;

await comp.dispose();

Expand Down

0 comments on commit d60165c

Please sign in to comment.