mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 02:17:31 +00:00
* fix(test): keep unit-test tooling inside the repo root in nested checkouts Vitest's oxc tsconfig auto-discovery walks past the repo for files no in-repo tsconfig owns, so a worktree nested in another checkout loaded the enclosing checkout's tsconfig. Pin the transform tsconfig to an explicit solution file listing the same projects auto-discovery finds. The local module cache policy hash failed on esbuild warnings from an ancestor package.json; only warnings located inside the root now fail. * fix(test): guard the pinned transform tsconfig against project drift Drop docs/site (no unit test transforms it) so its tsconfig cannot break every transform, and fail when a project tsconfig is added or removed without updating the pinned solution.
22 lines
966 B
JavaScript
22 lines
966 B
JavaScript
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
|
import { tmpdir } from 'node:os'
|
|
import { join } from 'node:path'
|
|
import { afterEach, expect, it } from 'vitest'
|
|
import { collectNodeServerInputs } from './node-server-change-scope.mjs'
|
|
|
|
let outer
|
|
afterEach(() => rmSync(outer, { recursive: true, force: true }))
|
|
|
|
it('ignores warnings from an enclosing checkout but not from the repo', async () => {
|
|
const duplicateKey = '{ "name": "x", "name": "y" }'
|
|
outer = mkdtempSync(join(tmpdir(), 'node-server-scope-outer-'))
|
|
const root = join(outer, 'repo')
|
|
mkdirSync(root)
|
|
writeFileSync(join(outer, 'package.json'), duplicateKey)
|
|
writeFileSync(join(root, 'entry.ts'), 'export {}')
|
|
const collect = () => collectNodeServerInputs({ root, entryPoints: ['entry.ts'] })
|
|
expect([...(await collect())]).toEqual(['entry.ts'])
|
|
writeFileSync(join(root, 'package.json'), duplicateKey)
|
|
await expect(collect()).rejects.toThrow('Duplicate key')
|
|
})
|