diff --git a/client/native-shell/main.ts b/client/native-shell/main.ts index 049134776..ad1b49e51 100644 --- a/client/native-shell/main.ts +++ b/client/native-shell/main.ts @@ -41,8 +41,15 @@ function failureMessage(reason: ProbeFailure): string { } } -function el(tag: K, props: Partial = {}, ...children: (Node | string)[]) { - const node = Object.assign(document.createElement(tag), props) +function el( + tag: K, + props: Partial = {}, + ...children: (Node | string)[] +): HTMLElementTagNameMap[K] { + // Typed as the plain element, not as Object.assign's intersection with the + // props, which strict mode cannot represent for an . + const node: HTMLElementTagNameMap[K] = document.createElement(tag) + Object.assign(node, props) node.append(...children) return node } diff --git a/client/src/native/haptics.test.ts b/client/src/native/haptics.test.ts index 232c54820..fa5f6a844 100644 --- a/client/src/native/haptics.test.ts +++ b/client/src/native/haptics.test.ts @@ -19,7 +19,7 @@ describe('toastHaptic', () => { toastHaptic('success') toastHaptic('warning') toastHaptic('error') - expect(vi.mocked(Haptics.notification).mock.calls.map(([o]) => o.type)).toEqual([ + expect(vi.mocked(Haptics.notification).mock.calls.map(([o]) => o?.type)).toEqual([ NotificationType.Success, NotificationType.Warning, NotificationType.Error, ]) }) diff --git a/client/src/native/offlineTiles.ts b/client/src/native/offlineTiles.ts index 87e6a87c8..abc87ea58 100644 --- a/client/src/native/offlineTiles.ts +++ b/client/src/native/offlineTiles.ts @@ -16,10 +16,10 @@ import { isNativeIos } from './platform' * the app. */ -export const OFFLINE_SCHEME = 'trek-offline' +const OFFLINE_SCHEME = 'trek-offline' const PREFIX = `${OFFLINE_SCHEME}://` -export function offlineTilesActive(): boolean { +function offlineTilesActive(): boolean { return isNativeIos() && typeof caches !== 'undefined' } diff --git a/client/src/native/serverAddress.ts b/client/src/native/serverAddress.ts index aa0717182..7729eaba8 100644 --- a/client/src/native/serverAddress.ts +++ b/client/src/native/serverAddress.ts @@ -4,7 +4,7 @@ */ export type ProbeFailure = 'invalid' | 'unreachable' | 'notTrek' | 'tooOld' -export type ProbeResult = +type ProbeResult = | { ok: true; url: string; reason?: undefined } | { ok: false; reason: ProbeFailure; url?: undefined } diff --git a/server/tests/e2e/native-auth.e2e.test.ts b/server/tests/e2e/native-auth.e2e.test.ts index 68674a34f..ae8502a7b 100644 --- a/server/tests/e2e/native-auth.e2e.test.ts +++ b/server/tests/e2e/native-auth.e2e.test.ts @@ -45,12 +45,7 @@ let userId: number; async function build() { const moduleRef = await Test.createTestingModule({ - imports: [ - await TestUnitOfWorkModule.forRoot(db), - await createTestMikroOrmModule(db), - AuthModule, - NativeAuthModule, - ], + imports: [await TestUnitOfWorkModule.forRoot(db), await createTestMikroOrmModule(db), AuthModule, NativeAuthModule], }) .overrideProvider(MailerService) .useValue({ sendPasswordResetEmail: vi.fn() })