Added getMemoryStorage as entry point
This commit is contained in:
parent
b490f08862
commit
ec543ddc3f
|
@ -1,4 +1,4 @@
|
||||||
import { getLocalStorage } from ".";
|
import { getLocalStorage, getMemoryStorage } from ".";
|
||||||
import { MemoryStorage, ScopedStorage } from "./basic";
|
import { MemoryStorage, ScopedStorage } from "./basic";
|
||||||
import { BrowserLocalStorage } from "./browser";
|
import { BrowserLocalStorage } from "./browser";
|
||||||
import { NodeDirectoryStorage } from "./node";
|
import { NodeDirectoryStorage } from "./node";
|
||||||
|
@ -41,3 +41,10 @@ describe(getLocalStorage, () => {
|
||||||
expect(mockWarn).toHaveBeenCalledWith("No persistent storage available, using in-memory volatile storage");
|
expect(mockWarn).toHaveBeenCalledWith("No persistent storage available, using in-memory volatile storage");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe(getMemoryStorage, () => {
|
||||||
|
it("returns a memory storage", () => {
|
||||||
|
const storage = getMemoryStorage();
|
||||||
|
expect(storage).toBeInstanceOf(MemoryStorage);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
@ -17,3 +17,10 @@ export function getLocalStorage(appname: string): KeyValueStorage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Récupère un stockage "mémoire"
|
||||||
|
*/
|
||||||
|
export function getMemoryStorage(): KeyValueStorage {
|
||||||
|
return new MemoryStorage();
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue