fix(runtime-core): renderList with default value when source is undefined (#498)
This commit is contained in:
committed by
Evan You
parent
bb39910e8e
commit
d4f4c7c4d4
@@ -41,4 +41,10 @@ describe('renderList', () => {
|
||||
renderList(iterable(), (item, index) => `node ${index}: ${item}`)
|
||||
).toEqual(['node 0: 1', 'node 1: 2', 'node 2: 3'])
|
||||
})
|
||||
|
||||
it('should return empty array when source is undefined', () => {
|
||||
expect(
|
||||
renderList(undefined, (item, index) => `node ${index}: ${item}`)
|
||||
).toEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user