DEV: Change test localStorage prefix (#17906)

…to something more easily recognizable and less collision-prone
This commit is contained in:
Jarek Radosz 2022-08-14 17:31:37 +02:00 committed by GitHub
parent 5d1cf006ab
commit 92035cdc62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
import { isTesting } from "discourse-common/config/environment";
const TEST_KEY_PREFIX = "__test_";
// A simple key value store that uses LocalStorage
let safeLocalStorage;
@ -20,7 +22,7 @@ export default class KeyValueStore {
context = null;
constructor(ctx) {
this.context = isTesting() ? `test_${ctx}` : ctx;
this.context = isTesting() ? `${TEST_KEY_PREFIX}${ctx}` : ctx;
}
abandonLocal() {