Revert eachSupportedId guard — env var fix is sufficient

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2026-05-19 23:23:37 +02:00
parent 2c53691962
commit 8abfa78e4c
3 changed files with 0 additions and 15 deletions
-5
View File
@@ -1,5 +0,0 @@
---
'@backstage/backend-test-utils': patch
---
Fixed a crash in test suites that use `TestDatabases` or `TestCaches` when none of the requested database or cache engines are available. Previously, `eachSupportedId()` would return an empty array causing `describe.each` to throw and prevent the entire suite from running. Now returns a placeholder entry so individual tests report a clear failure instead.
-3
View File
@@ -108,9 +108,6 @@ export class TestCaches {
}
eachSupportedId(): [TestCacheId][] {
if (this.supportedIds.length === 0) {
return [['MISSING' as TestCacheId]];
}
return this.supportedIds.map(id => [id]);
}
@@ -124,13 +124,6 @@ export class TestDatabases {
}
eachSupportedId(): [TestDatabaseId][] {
if (this.supportedIds.length === 0) {
// Return a placeholder so that describe.each/it.each does not throw
// when no databases are available. The init() call will throw for
// the unknown ID, causing the test to be reported as failed rather
// than crashing the entire suite.
return [['MISSING' as TestDatabaseId]];
}
return this.supportedIds.map(id => [id]);
}