Skip to content

Commit 5b8661a

Browse files
committed
chore: properly handle test failure
chore: wip
1 parent d39d8cb commit 5b8661a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

test/deps-yaml-update.test.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,18 @@ describe('Bun deps.yaml Update Tests', () => {
5454

5555
afterAll(async () => {
5656
// Clean up
57-
process.chdir(originalCwd)
58-
await rm(testDir, { recursive: true, force: true })
57+
try {
58+
if (process.cwd() === testDir) {
59+
process.chdir(originalCwd)
60+
}
61+
if (testDir && testDir.startsWith(tmpdir())) {
62+
await rm(testDir, { recursive: true, force: true }).catch(() => { /* Ignore errors during cleanup */ })
63+
}
64+
}
65+
catch (error) {
66+
// Ignore cleanup errors
67+
console.warn('Cleanup warning:', error)
68+
}
5969
})
6070

6171
// Setup fresh mocks before each test
@@ -161,7 +171,6 @@ describe('Bun deps.yaml Update Tests', () => {
161171
expect(hasBunUpdate).toBe(true)
162172
})
163173

164-
165174
test('should handle case-insensitive filenames', async () => {
166175
// Setup mock to return updates for this test
167176
mockGetOutdatedPackages.mockResolvedValueOnce([

0 commit comments

Comments
 (0)