mirror of
https://github.com/stablyai/orca.git
synced 2026-10-07 08:02:21 +00:00
* Run Vitest on Bun while preserving Node runtime contracts * Preserve runtime timing provenance and keep the Bun pin in config * Scope builtin compatibility mocks to test-only lint exceptions * Give capture retention fixtures distinct filesystem timestamps * Await the copy button success state in the React fixture * Bound Node test worker shutdown and tighten migration fixtures
23 lines
995 B
TypeScript
23 lines
995 B
TypeScript
import { expect, it } from 'vitest'
|
|
import { access } from 'node:fs/promises'
|
|
import { runProcessSync } from '../../src/shared/child-process/run-process'
|
|
|
|
it('uses Bun for ordinary suites when the Bun project is selected', () => {
|
|
expect(Boolean(process.versions.bun)).toBe(process.env.ORCA_VITEST_RUNTIME === 'bun')
|
|
})
|
|
|
|
it('preserves Node access() success and missing-file rejection', async () => {
|
|
await expect(access(import.meta.filename)).resolves.toBeUndefined()
|
|
await expect(access(`${import.meta.filename}.missing`)).rejects.toMatchObject({ code: 'ENOENT' })
|
|
})
|
|
|
|
it('launches application child fixtures under Node even when Vitest runs under Bun', () => {
|
|
const result = runProcessSync({
|
|
program: process.execPath,
|
|
args: ['-p', 'JSON.stringify({node:process.versions.node,bun:process.versions.bun})']
|
|
})
|
|
expect(result.code).toBe(0)
|
|
const identity: unknown = JSON.parse(result.stdout)
|
|
expect(identity).toEqual({ node: expect.stringMatching(/^\d+\.\d+\.\d+$/) })
|
|
})
|