mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 02:47:34 +00:00
* test: remove 98 low-value mobile tests * test: drop stale typecheck allowance for removed browser budget test --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
34 lines
984 B
JavaScript
34 lines
984 B
JavaScript
import { existsSync } from 'node:fs'
|
|
import { expect, it } from 'vitest'
|
|
import {
|
|
prepareRouteSnapshot,
|
|
withRouteSnapshot
|
|
} from '../mobile-web/check-entry/run-mobile-web-app-checks.mjs'
|
|
|
|
const collect = async (entries) => ({
|
|
modules: [...entries, 'node_modules/react/index.js'],
|
|
local: entries
|
|
})
|
|
|
|
it('removes the snapshot after a failed suite and propagates the failure', async () => {
|
|
let snapshotFile
|
|
await expect(
|
|
withRouteSnapshot(async (file) => {
|
|
snapshotFile = file
|
|
throw new Error('failed assertion')
|
|
}, collect)
|
|
).rejects.toThrow('failed assertion')
|
|
expect(existsSync(snapshotFile)).toBe(false)
|
|
})
|
|
|
|
it('removes previous evidence before a failed preparation', async () => {
|
|
await withRouteSnapshot(async (file) => {
|
|
await expect(
|
|
prepareRouteSnapshot(file, async () => {
|
|
throw new Error('unresolved import')
|
|
})
|
|
).rejects.toThrow('unresolved import')
|
|
expect(existsSync(file)).toBe(false)
|
|
}, collect)
|
|
})
|