/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
e2e/__tests__/localStorage.test.ts
22 строки
686 B
Simen Bekkhus
fix(node-env): do not warn on `localStorage` unless actually accessed (#16086)
03 май 2026, 10:58
Не верифицирован
03 май 2026, 10:58
35eac0e
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import tempy from 'tempy'; import {onNodeVersions} from '@jest/test-utils'; import runJest from '../runJest'; onNodeVersions('>=25', () => { it('localStorage CRUD works inside a Jest test', async () => { await tempy.file.task(storageFile => { const result = runJest('local-storage', [], { nodeOptions: `--localstorage-file=${storageFile}`, }); expect(result.exitCode).toBe(0); expect(result.stderr).not.toContain('--localstorage-file'); }); }); });