diff --git a/packages/insomnia-smoke-test/src/modules/application.ts b/packages/insomnia-smoke-test/src/modules/application.ts index 0eb8ef613b6..109fa316e89 100644 --- a/packages/insomnia-smoke-test/src/modules/application.ts +++ b/packages/insomnia-smoke-test/src/modules/application.ts @@ -1,12 +1,12 @@ import { Application } from 'spectron'; import path from 'path'; import os from 'os'; -// @ts-expect-error -- TSCONVERSION appears to be genuine -import electronPath from '../../../insomnia-app/node_modules/electron'; import mkdirp from 'mkdirp'; import fs from 'fs'; import { Config } from '../entities'; +const electronPath = '../../../insomnia-app/node_modules/electron'; + const getAppPlatform = () => process.platform; const isMac = () => getAppPlatform() === 'darwin'; const isLinux = () => getAppPlatform() === 'linux'; @@ -70,7 +70,9 @@ const launch = async (config?: Config) => { // Windows spawns two terminal windows when running spectron, and the only workaround // is to focus the window on start. // https://github.com/electron-userland/spectron/issues/60 + // @ts-expect-error -- TSCONVERSION await app.browserWindow.focus(); + // @ts-expect-error -- TSCONVERSION await app.browserWindow.setAlwaysOnTop(true); // Set the implicit wait timeout to 0 (webdriver default) @@ -80,6 +82,7 @@ const launch = async (config?: Config) => { await app.client.setTimeout({ implicit: 0 }); // Set bounds to default size + // @ts-expect-error -- TSCONVERSION await app.browserWindow.setSize(1280, 700); }); return app; @@ -93,7 +96,6 @@ export const launchApp = async (designerDataPath?: string) => { export const takeScreenshot = async (app: Application, name: string) => { mkdirp.sync('screenshots'); const buffer = await app.browserWindow.capturePage(); - // @ts-expect-error -- TSCONVERSION appears to be genuine await fs.promises.writeFile(path.join('screenshots', `${name}.png`), buffer); }; diff --git a/packages/insomnia-smoke-test/src/modules/client.ts b/packages/insomnia-smoke-test/src/modules/client.ts index d2560866e4c..879a5c68445 100644 --- a/packages/insomnia-smoke-test/src/modules/client.ts +++ b/packages/insomnia-smoke-test/src/modules/client.ts @@ -4,7 +4,9 @@ export const correctlyLaunched = async (app: Application) => { // @ts-expect-error -- TSCONVERSION appears to be genuine await expect(app.browserWindow.isDevToolsOpened()).resolves.toBe(false); await expect(app.client.getWindowCount()).resolves.toBe(1); + // @ts-expect-error -- TSCONVERSION await expect(app.browserWindow.isMinimized()).resolves.toBe(false); + // @ts-expect-error -- TSCONVERSION await expect(app.browserWindow.isFocused()).resolves.toBe(true); }; diff --git a/packages/insomnia-smoke-test/tsconfig.build.json b/packages/insomnia-smoke-test/tsconfig.build.json index c9d063144fa..8aba2e14806 100644 --- a/packages/insomnia-smoke-test/tsconfig.build.json +++ b/packages/insomnia-smoke-test/tsconfig.build.json @@ -6,13 +6,13 @@ "rootDir": "src", "resolveJsonModule": true, "esModuleInterop": true, - "strict": true + "skipLibCheck": true, // this is required because spectron depends on electron but it is not locatable by typescript for the purpose of types }, "include": [ - "src" + "src", ], "exclude": [ "src/jest", - "**/*.test.ts" + "**/*.test.ts", ] } \ No newline at end of file