Skip to content

Commit f075423

Browse files
committed
test: use Flags comment option to set a localstorage file
1 parent bc29973 commit f075423

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

β€Žtest/common/index.jsβ€Ž

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -317,21 +317,7 @@ const knownGlobals = new Set([
317317
'localStorage',
318318
'sessionStorage',
319319
].forEach((i) => {
320-
if (i === 'localStorage') {
321-
const getLocalStorage = Object.defineProperty(() => {}, 'name', {
322-
value: 'get localStorage',
323-
});
324-
325-
Object.defineProperties(globalThis, {
326-
localStorage: {
327-
configurable: true,
328-
enumerable: true,
329-
get: getLocalStorage,
330-
},
331-
});
332-
333-
knownGlobals.add(globalThis[i]);
334-
} else if (globalThis[i] !== undefined) {
320+
if (globalThis[i] !== undefined) {
335321
knownGlobals.add(globalThis[i]);
336322
}
337323
});

β€Žtest/fixtures/localstoragefile-global-testβ€Ž

Whitespace-only changes.

β€Žtest/parallel/test-global.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
// This test cannot run in strict mode because it tests that `baseFoo` is
2323
// treated as a global without being declared with `var`/`let`/`const`.
2424

25+
// Flags: --localstorage-file=./test/fixtures/localstoragefile-global-test
2526
/* eslint-disable strict */
2627
const common = require('../common');
2728
const fixtures = require('../common/fixtures');

β€Žtest/parallel/test-webstorage.jsβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
'use strict';
2+
3+
// Flags: --localstorage-file=./test/fixtures/localstoragefile-global-test
24
const { skipIfSQLiteMissing, spawnPromisified } = require('../common');
35
skipIfSQLiteMissing();
46
const tmpdir = require('../common/tmpdir');

0 commit comments

Comments
Β (0)