mirror of
https://git.unlock-music.dev/um/um-react.git
synced 2025-05-23 16:27:41 +08:00
25 lines
519 B
TypeScript
25 lines
519 B
TypeScript
import { enumObject } from '../objects';
|
|
|
|
test('it should ignore and not crash with non-object', () => {
|
|
expect(Array.from(enumObject('string' as never))).toEqual([]);
|
|
});
|
|
|
|
test('it should ignore and not crash with null', () => {
|
|
expect(Array.from(enumObject(null))).toEqual([]);
|
|
});
|
|
|
|
test('it be able to iterate object', () => {
|
|
expect(Array.from(enumObject({ a: '1', b: '2' }))).toMatchInlineSnapshot(`
|
|
[
|
|
[
|
|
"a",
|
|
"1",
|
|
],
|
|
[
|
|
"b",
|
|
"2",
|
|
],
|
|
]
|
|
`);
|
|
});
|