diff options
| author | Oskar <oskar@mullvad.net> | 2024-10-08 15:23:39 +0200 |
|---|---|---|
| committer | Oskar <oskar@mullvad.net> | 2024-10-22 15:18:10 +0200 |
| commit | 1666ff934d648dc88f213a90dde96b1b0eca7692 (patch) | |
| tree | 98ca27b363648769cfb1e41ddab503c72172e088 /gui/test | |
| parent | 411a5eedc83e1b43ebe48c05b382c54105d0a029 (diff) | |
| download | mullvadvpn-1666ff934d648dc88f213a90dde96b1b0eca7692.tar.xz mullvadvpn-1666ff934d648dc88f213a90dde96b1b0eca7692.zip | |
Prohibit @ts-ignore comments and update codebase to not use it
Diffstat (limited to 'gui/test')
| -rw-r--r-- | gui/test/unit/notification-evaluation.spec.ts | 2 | ||||
| -rw-r--r-- | gui/test/unit/tunnel-state.spec.ts | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/gui/test/unit/notification-evaluation.spec.ts b/gui/test/unit/notification-evaluation.spec.ts index 723307b3d7..d05e967efc 100644 --- a/gui/test/unit/notification-evaluation.spec.ts +++ b/gui/test/unit/notification-evaluation.spec.ts @@ -28,7 +28,7 @@ describe('System notifications', () => { before(() => { sandbox = sinon.createSandbox(); - // @ts-ignore + // @ts-expect-error Way too many methods to mock. sandbox.stub(NotificationController.prototype, 'createElectronNotification').returns({ show: () => { /* no-op */ diff --git a/gui/test/unit/tunnel-state.spec.ts b/gui/test/unit/tunnel-state.spec.ts index a6013523b8..e751b50c57 100644 --- a/gui/test/unit/tunnel-state.spec.ts +++ b/gui/test/unit/tunnel-state.spec.ts @@ -14,7 +14,7 @@ const error: TunnelState = { state: 'error' } as TunnelState; describe('Tunnel state', () => { it('Should allow all updates', () => { const stateUpdateSpy = spy(); - // @ts-ignore + // @ts-expect-error stateUpdateSpy doesn't know what type to accept const handleTunnelStateUpdate = (tunnelState: TunnelState) => stateUpdateSpy(tunnelState.state); const tunnelStateHandler = new TunnelStateHandler({ handleTunnelStateUpdate }); @@ -33,7 +33,7 @@ describe('Tunnel state', () => { it('Should ignore non-expected state update', () => { const stateUpdateSpy = spy(); - // @ts-ignore + // @ts-expect-error stateUpdateSpy doesn't know what type to accept const handleTunnelStateUpdate = (tunnelState: TunnelState) => stateUpdateSpy(tunnelState.state); const tunnelStateHandler = new TunnelStateHandler({ handleTunnelStateUpdate }); @@ -49,7 +49,7 @@ describe('Tunnel state', () => { it('Should allow new states after expected state is reached', () => { const stateUpdateSpy = spy(); - // @ts-ignore + // @ts-expect-error stateUpdateSpy doesn't know what type to accept const handleTunnelStateUpdate = (tunnelState: TunnelState) => stateUpdateSpy(tunnelState.state); const tunnelStateHandler = new TunnelStateHandler({ handleTunnelStateUpdate }); @@ -67,7 +67,7 @@ describe('Tunnel state', () => { it('Should allow error state update', () => { const stateUpdateSpy = spy(); - // @ts-ignore + // @ts-expect-error stateUpdateSpy doesn't know what type to accept const handleTunnelStateUpdate = (tunnelState: TunnelState) => stateUpdateSpy(tunnelState.state); const tunnelStateHandler = new TunnelStateHandler({ handleTunnelStateUpdate }); @@ -86,7 +86,7 @@ describe('Tunnel state', () => { it('Should time out and use last ignored state', () => { const clock = sinon.useFakeTimers({ shouldAdvanceTime: true }); const stateUpdateSpy = spy(); - // @ts-ignore + // @ts-expect-error stateUpdateSpy doesn't know what type to accept const handleTunnelStateUpdate = (tunnelState: TunnelState) => stateUpdateSpy(tunnelState.state); const tunnelStateHandler = new TunnelStateHandler({ handleTunnelStateUpdate }); |
