Skip to content

Commit a77736d

Browse files
committed
fix: add timing delay to multiple modules test and coverage to release
- Added 100ms delay in multiple modules test to prevent race conditions in coverage tests - Updated release script to run coverage tests before release - Ensures all tests pass in both normal and coverage mode
1 parent a226504 commit a77736d

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

scripts/release.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,15 @@ function main() {
292292
log('✅ All tests passed', 'green');
293293
}
294294

295+
// Step 3.5: Run coverage tests
296+
if (skipTests) {
297+
log('\n📊 Step 3.5: Skipping coverage tests (--skip-tests)', 'yellow');
298+
} else {
299+
log('\n📊 Step 3.5: Running coverage tests', 'blue');
300+
exec('npm run test:coverage');
301+
log('✅ Coverage tests passed', 'green');
302+
}
303+
295304
// Step 4: Run package validation tests
296305
if (skipTests) {
297306
log('\n📦 Step 4: Skipping package validation (--skip-tests)', 'yellow');

tests/integration/module-direct-registration.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ describe('Module Routes - Direct Registration Fix', () => {
259259
expect(notFoundData.error).toBe('Not found');
260260
});
261261

262-
it('should handle multiple modules with overlapping base paths', async () => {
262+
it('should handle multiple modules with different base paths', async () => {
263263
const module1Actions = {
264264
test: async () => ({ success: true, module: '1' }),
265265
};
@@ -287,13 +287,20 @@ describe('Module Routes - Direct Registration Fix', () => {
287287
app.listen(port, () => resolve());
288288
});
289289

290+
// Add delay for coverage test timing
291+
await new Promise(resolve => setTimeout(resolve, 100));
292+
290293
// Test both modules
291294
const response1 = await fetch(`http://localhost:${port}/api/v1.0.0/module1/test`);
295+
expect(response1.status).toBe(200);
292296
const data1 = await response1.json();
297+
expect(data1.success).toBe(true);
293298
expect(data1.module).toBe('1');
294299

295300
const response2 = await fetch(`http://localhost:${port}/api/v1.0.0/module2/test`);
301+
expect(response2.status).toBe(200);
296302
const data2 = await response2.json();
303+
expect(data2.success).toBe(true);
297304
expect(data2.module).toBe('2');
298305
});
299306
});

0 commit comments

Comments
 (0)