/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/data/src/plugins/persistence/storage/test/object.js
38 строк
930 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import objectStorage from '../object'; describe( 'objectStorage', () => { beforeEach( () => { objectStorage.clear(); } ); describe( 'getItem', () => { it( 'should return null if there is no item with key', () => { const result = objectStorage.getItem( 'foo' ); expect( result ).toBe( null ); } ); it( 'should return the value of assigned item', () => { objectStorage.setItem( 'foo', 'bar' ); const result = objectStorage.getItem( 'foo' ); expect( result ).toBe( 'bar' ); } ); } ); describe( 'setItem', () => { it( 'should set item by key for future retrieval', () => { objectStorage.setItem( 'foo', 'bar' ); const result = objectStorage.getItem( 'foo' ); expect( result ).toBe( 'bar' ); } ); it( 'should assign as string', () => { objectStorage.setItem( 'foo', null ); const result = objectStorage.getItem( 'foo' ); expect( result ).toBe( 'null' ); } ); } ); } );