Skip to content

Commit 06be51d

Browse files
authored
fix storage tests (#471)
1 parent 040a175 commit 06be51d

File tree

2 files changed

+126
-244
lines changed

2 files changed

+126
-244
lines changed

typescript/packages/common-charm/src/storage.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,12 @@ class StorageImpl implements Storage {
233233
let provider = this.storageProviders.get(space);
234234

235235
if (!provider) {
236-
const type = (import.meta as any).env?.VITE_STORAGE_TYPE ?? "remote";
236+
// Default to "remote", but let either custom URL (used in tests) or
237+
// environment variable override this.
238+
const type =
239+
this.remoteStorageUrl?.protocol === "memory:"
240+
? "memory"
241+
: ((import.meta as any).env?.VITE_STORAGE_TYPE ?? "remote");
237242

238243
if (type === "remote") {
239244
if (!this.remoteStorageUrl) throw new Error("No remote storage URL set");

0 commit comments

Comments
 (0)