refactor: fix typescript strict flag failures in all tests (#30993)
Fixes all TypeScript failures caused by enabling the `--strict` flag for test source files. We also want to enable the strict options for tests as the strictness enforcement improves the overall codehealth, unveiled common issues and additionally it allows us to enable `strict` in the `tsconfig.json` that is picked up by IDE's. PR Close #30993
This commit is contained in:

committed by
Miško Hevery

parent
69a612d402
commit
647d7bdd88
@ -67,7 +67,7 @@ if (browserDetection.supportsCustomElements) {
|
||||
element.connectedCallback();
|
||||
|
||||
let eventValue: any = null;
|
||||
element.addEventListener('some-event', (e: CustomEvent) => eventValue = e.detail);
|
||||
element.addEventListener('some-event', (e: Event) => eventValue = (e as CustomEvent).detail);
|
||||
strategy.events.next({name: 'some-event', value: 'event-value'});
|
||||
|
||||
expect(eventValue).toEqual('event-value');
|
||||
@ -80,7 +80,7 @@ if (browserDetection.supportsCustomElements) {
|
||||
expect(strategy.disconnectCalled).toBe(true);
|
||||
|
||||
let eventValue: any = null;
|
||||
element.addEventListener('some-event', (e: CustomEvent) => eventValue = e.detail);
|
||||
element.addEventListener('some-event', (e: Event) => eventValue = (e as CustomEvent).detail);
|
||||
strategy.events.next({name: 'some-event', value: 'event-value'});
|
||||
|
||||
expect(eventValue).toEqual(null);
|
||||
|
Reference in New Issue
Block a user