1 parent 6be2427 commit cb85eb2Copy full SHA for cb85eb2
1 file changed
test/server.test.js
@@ -67,9 +67,16 @@ describe('server API endpoints', () => {
67
assert.ok(port > 0, 'port should be assigned');
68
});
69
70
- after(() => {
71
- stopViewer();
72
- rmSync(tmpDir, { recursive: true, force: true });
+ after(async () => {
+ // Wait for server to fully close to avoid EPIPE from lingering async activity
+ await new Promise((resolve) => {
73
+ stopViewer();
74
+ // Give server.close() time to finish pending connections
75
+ setTimeout(() => {
76
+ rmSync(tmpDir, { recursive: true, force: true });
77
+ resolve();
78
+ }, 200);
79
+ });
80
81
82
// --- CORS ---
0 commit comments