backend-test-utils: avoid cleanup if no databases are supported

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-03-24 13:19:59 +01:00
parent 8dfaa20c52
commit 0654c87cf2
2 changed files with 10 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-test-utils': patch
---
`TestDatabases.create` will no longer set up an `afterAll` test handler if no databases are supported.
@@ -91,9 +91,11 @@ export class TestDatabases {
const databases = new TestDatabases(supportedIds);
afterAll(async () => {
await databases.shutdown();
});
if (supportedIds.length > 0) {
afterAll(async () => {
await databases.shutdown();
});
}
return databases;
}