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:
@@ -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.
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user