mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
test: remove duplicate coverage and strengthen boundary assertions (#33047)
* test: strengthen launch, subject identity, and release witnesses * test: strengthen approval paths and prompt answer boundaries * test: strengthen conversation names and mobile log persistence * refactor: group background task stop contract with stop operations * test: strengthen question, title, and release validation * test: distinguish row text and generated dispatch titles * test: verify mobile revival events and retry exclusivity * test: reject incomplete child row output assertions * test: verify copied modules and option selection contracts * test: verify mobile host state and status retry boundaries * test: observe connector refusals and real diagnostic delivery * test: consolidate platform memory coverage and verify bounded work * test: allow cached legacy failure reads within work bounds * test: verify packaging boundaries with independent fixtures --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -4,15 +4,20 @@ import {
|
||||
mkdtempSync,
|
||||
readdirSync,
|
||||
readFileSync,
|
||||
rmSync,
|
||||
writeFileSync
|
||||
} from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { afterAll, describe, expect, it } from 'vitest'
|
||||
import { copyScriptWithLocalModules } from './script-module-dependencies.mjs'
|
||||
|
||||
const fixtureDir = mkdtempSync(join(tmpdir(), 'script-module-dependencies-'))
|
||||
|
||||
afterAll(() => {
|
||||
rmSync(fixtureDir, { recursive: true, force: true })
|
||||
})
|
||||
|
||||
function sourceTree(files) {
|
||||
const sourceDir = mkdtempSync(join(fixtureDir, 'source-'))
|
||||
for (const [name, contents] of Object.entries(files)) {
|
||||
@@ -25,7 +30,11 @@ function copiedNames(files, entryName) {
|
||||
const sourceDir = sourceTree(files)
|
||||
const destinationDir = join(mkdtempSync(join(fixtureDir, 'dest-')), 'scripts')
|
||||
copyScriptWithLocalModules(join(sourceDir, entryName), destinationDir)
|
||||
return readdirSync(destinationDir).sort()
|
||||
const names = readdirSync(destinationDir).sort()
|
||||
for (const name of names) {
|
||||
expect(readFileSync(join(destinationDir, name), 'utf8'), name).toBe(files[name])
|
||||
}
|
||||
return names
|
||||
}
|
||||
|
||||
describe('copyScriptWithLocalModules', () => {
|
||||
|
||||
Reference in New Issue
Block a user