mirror of
https://github.com/Gitlawb/openclaude.git
synced 2026-08-24 02:34:15 -05:00
fix flaky test (#1021)
This commit is contained in:
@@ -100,6 +100,18 @@ function tsc(tmpDir: string): string {
|
||||
}).trim()
|
||||
}
|
||||
|
||||
function ensureBuildArtifacts(): void {
|
||||
const distCli = join(ROOT, 'dist', 'cli.mjs')
|
||||
const distSdk = join(ROOT, 'dist', 'sdk.mjs')
|
||||
if (existsSync(distCli) && existsSync(distSdk)) return
|
||||
|
||||
execSync('bun run build', {
|
||||
cwd: ROOT,
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
timeout: 180000,
|
||||
})
|
||||
}
|
||||
|
||||
afterAll(() => {
|
||||
for (const dir of tempDirs) {
|
||||
try {
|
||||
@@ -215,6 +227,8 @@ describe('package exports resolution', () => {
|
||||
})
|
||||
|
||||
test('exported files exist after build', () => {
|
||||
ensureBuildArtifacts()
|
||||
|
||||
// Verify the files referenced in exports exist
|
||||
expect(existsSync(join(ROOT, 'package.json'))).toBe(true)
|
||||
expect(existsSync(join(ROOT, 'dist', 'cli.mjs'))).toBe(true)
|
||||
|
||||
Reference in New Issue
Block a user