mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 09:27:29 +00:00
* test: remove 60 low-value cases and orphaned conversion fixtures * docs(ci): list supported Windows SSH host cells * test: recognize direct Windows orcad server entry --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { mkdtemp, rm, writeFile } from 'node:fs/promises'
|
|
import { tmpdir } from 'node:os'
|
|
import { join } from 'node:path'
|
|
import { PassThrough } from 'node:stream'
|
|
import { expect, it, onTestFinished } from 'vitest'
|
|
import { createVitest } from 'vitest/node'
|
|
|
|
import { nodeRuntimePool } from './vitest-node-runtime-pool'
|
|
|
|
it('reports a test file that fails to load as a failed file instead of crashing the run', async () => {
|
|
const dir = await mkdtemp(join(tmpdir(), 'orca-node-runtime-pool-'))
|
|
onTestFinished(() => rm(dir, { recursive: true, force: true }))
|
|
await writeFile(join(dir, 'load-failure.test.ts'), "import './orca-missing-module'\n")
|
|
const nested = await createVitest(
|
|
'test',
|
|
{
|
|
config: false,
|
|
watch: false,
|
|
dir,
|
|
include: ['**/*.test.ts'],
|
|
pool: 'node-runtime',
|
|
poolRunner: nodeRuntimePool,
|
|
reporters: [],
|
|
env: { ORCA_TEST_NODE_EXECUTABLE: process.execPath }
|
|
},
|
|
{},
|
|
{ stdout: new PassThrough(), stderr: new PassThrough() }
|
|
)
|
|
try {
|
|
await nested.start()
|
|
const [file] = nested.state.getFiles()
|
|
expect(file.result?.state).toBe('fail')
|
|
expect(file.result?.errors?.[0]?.message).toContain('orca-missing-module')
|
|
expect(nested.state.getUnhandledErrors()).toEqual([])
|
|
} finally {
|
|
await nested.close()
|
|
}
|
|
})
|