Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e6363b1

Browse filesBrowse files
committed
Merge pull request immutable-js#598 from kevinold/test_list_get_null
Add tests that sending a null argument to List.get() should return undefined
2 parents 59028b5 + 6e01adf commit e6363b1
Copy full SHA for e6363b1

File tree

Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed

‎__tests__/List.ts

Copy file name to clipboardExpand all lines: __tests__/List.ts
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ describe('List', () => {
8080
expect(v.get(0)).toBe('value');
8181
});
8282

83+
it('returns undefined when getting a null value', () => {
84+
var v = Immutable.List([1, 2, 3]);
85+
expect(v.get(null)).toBe(undefined);
86+
87+
var o = Immutable.List([{ a: 1 },{ b: 2 }, { c: 3 }]);
88+
expect(o.get(null)).toBe(undefined);
89+
});
90+
8391
it('counts from the end of the list on negative index', () => {
8492
var i = Immutable.List.of(1, 2, 3, 4, 5, 6, 7);
8593
expect(i.get(-1)).toBe(7);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.