/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/block-editor/src/hooks/test/utils.js
29 строк
689 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { cleanEmptyObject } from '../utils'; describe( 'cleanEmptyObject', () => { it( 'should remove nested keys', () => { expect( cleanEmptyObject( { color: { text: undefined } } ) ).toEqual( undefined ); } ); it( 'should remove partial nested keys', () => { expect( cleanEmptyObject( { color: { text: undefined }, typography: { fontSize: '10px' }, } ) ).toEqual( { typography: { fontSize: '10px' }, } ); } ); it( 'should not remove falsy nested keys', () => { expect( cleanEmptyObject( { color: { text: false } } ) ).not.toEqual( undefined ); expect( cleanEmptyObject( { color: { text: '' } } ) ).not.toEqual( undefined ); } ); } );