You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
427 B
24 lines
427 B
|
2 years ago
|
import { describe, expect, it } from '@jest/globals'
|
||
|
|
import toArray from './toArray.js'
|
||
|
|
|
||
|
|
describe('toArray', () => {
|
||
|
|
it('should convert a array-like object into an array', () => {
|
||
|
|
const obj = {
|
||
|
|
0: 'zero',
|
||
|
|
1: 'one',
|
||
|
|
2: 'two',
|
||
|
|
3: 'three',
|
||
|
|
4: 'four',
|
||
|
|
length: 5,
|
||
|
|
}
|
||
|
|
|
||
|
|
expect(toArray(obj)).toEqual([
|
||
|
|
'zero',
|
||
|
|
'one',
|
||
|
|
'two',
|
||
|
|
'three',
|
||
|
|
'four',
|
||
|
|
])
|
||
|
|
})
|
||
|
|
})
|