mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-15 12:53:31 +08:00
Avoid Bun filter-mode repository scans that exhaust macOS file descriptors and corrupt subprocess test evidence. Apply rooted filters across server, contract, coverage, persistence, policy, desktop native, and adapter test entrypoints. Confidence: high Scope-risk: narrow Tested: bun run check:policy; bun run check:server; bun run check:chat-contract
27 lines
864 B
TypeScript
27 lines
864 B
TypeScript
import { describe, expect, test } from 'bun:test'
|
|
import { rootBunTestFilter } from './bun-test-filter'
|
|
|
|
describe('rootBunTestFilter', () => {
|
|
test('roots repository-relative files and directories', () => {
|
|
expect(rootBunTestFilter('src/server/example.test.ts')).toBe(
|
|
'./src/server/example.test.ts',
|
|
)
|
|
expect(rootBunTestFilter('electron')).toBe('./electron')
|
|
})
|
|
|
|
test('preserves already rooted and absolute filters', () => {
|
|
expect(rootBunTestFilter('./src/example.test.ts')).toBe(
|
|
'./src/example.test.ts',
|
|
)
|
|
expect(rootBunTestFilter('../shared/example.test.ts')).toBe(
|
|
'../shared/example.test.ts',
|
|
)
|
|
expect(rootBunTestFilter('/tmp/example.test.ts')).toBe(
|
|
'/tmp/example.test.ts',
|
|
)
|
|
expect(rootBunTestFilter('C:\\repo\\example.test.ts')).toBe(
|
|
'C:\\repo\\example.test.ts',
|
|
)
|
|
})
|
|
})
|