The merge landed main's `minimize-to-tray` and `hud-modifier-types` modules next to ours, leaving two `perfectionist/sort-imports` errors — the only blocking failures in the `JS & TS checks` job (`apps/desktop :: check:lint`): electron/main.ts:321 ./minimize-to-tray before ./native-auth-decisions src/global.d.ts:6 ../electron/hud-modifier-types before ../electron/machine-profile Resolved with the workspace's own `npm run fix` (eslint --fix + prettier), which also pads the `padding-line-between-statements` warnings it can. Lint is 0 errors after.
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import type { InstallStamp } from '../install-stamp'
|
|
|
|
import { ExternalStrategy } from './external'
|
|
|
|
import { resolveUpdaterMechanism, type UpdaterStrategy } from './index'
|
|
|
|
const message: string = "This build doesn't get updates. Ask the developer who gave it to you for a new build."
|
|
|
|
describe('one-commit artifacts', (): void => {
|
|
it.each(['win32', 'darwin', 'linux'] as const)(
|
|
'cannot select an active updater on %s',
|
|
(platform: NodeJS.Platform): void => {
|
|
for (const updateMechanism of [
|
|
'self',
|
|
'app-installer',
|
|
'electron-updater',
|
|
'microsoft-store',
|
|
'external'
|
|
] as const) {
|
|
expect(resolveUpdaterMechanism({ platform, updateMechanism, source: 'commit-build' })).toBe('external')
|
|
}
|
|
}
|
|
)
|
|
|
|
it('refuses both checks and apply with no manual-update escape', async (): Promise<void> => {
|
|
const stamp: InstallStamp = { source: 'commit-build' } as InstallStamp
|
|
const strategy: UpdaterStrategy = new ExternalStrategy(stamp)
|
|
expect(await strategy.check({ force: true })).toMatchObject({
|
|
supported: false,
|
|
mechanism: 'external',
|
|
reason: 'commit-build',
|
|
message
|
|
})
|
|
expect(await strategy.apply()).toMatchObject({
|
|
ok: false,
|
|
mechanism: 'external',
|
|
error: 'commit-build',
|
|
message
|
|
})
|
|
expect(await strategy.apply()).not.toHaveProperty('command')
|
|
})
|
|
})
|