Skip to content

Commit 3a60a4b

Browse files
committed
chore: adjust test for ci
1 parent 3e9dca9 commit 3a60a4b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/plugin-architecture.test.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,21 @@ describe('Integration Ecosystem & Plugin Architecture', () => {
106106
})
107107

108108
// Restore original working directory and clean up temp directory
109-
process.chdir(originalCwd)
109+
// Check if originalCwd still exists before trying to change to it
110+
try {
111+
if (fs.existsSync(originalCwd)) {
112+
process.chdir(originalCwd)
113+
}
114+
else {
115+
// If originalCwd doesn't exist, change to OS temp directory as a safe fallback
116+
// eslint-disable-next-line ts/no-require-imports
117+
process.chdir(require('node:os').tmpdir())
118+
}
119+
}
120+
catch {
121+
// If we can't change directory, just continue with cleanup
122+
}
123+
110124
try {
111125
fs.rmSync(tempDir, { recursive: true, force: true })
112126
}

0 commit comments

Comments
 (0)