test(gateway): cross-user-isolation cleanup honors dbAvailable — unblocks gated publish verify (#1275) #1304
@@ -190,7 +190,13 @@ beforeEach((ctx) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
if (!handle) return;
|
// Cleanup only when the fixture actually installed rows. `handle` is set
|
||||||
|
// before the first query (createDb connects lazily), so on an unreachable
|
||||||
|
// database `handle` is truthy while nothing was inserted — cleanup must
|
||||||
|
// honor `dbAvailable` or the skip path fails the file with ECONNREFUSED in
|
||||||
|
// afterAll (caught live by the publish pipeline's no-DATABASE_URL verify
|
||||||
|
// step, pipeline 2486).
|
||||||
|
if (!handle || !dbAvailable) return;
|
||||||
const db = handle.db;
|
const db = handle.db;
|
||||||
|
|
||||||
// Delete in dependency order (FK constraints)
|
// Delete in dependency order (FK constraints)
|
||||||
|
|||||||
Reference in New Issue
Block a user