Commit 66a1cd2
authored
test: add edge case coverage for Array.prototype.find (#5221)
I added test cases for Array.prototype.find covering edge cases that
weren't tested before:
- Empty array returns undefined
- No match returns undefined
- Returns first match not last
- Works correctly with objects
- Callback receives correct index
- Sparse array holes are visited
No existing tests were removed or modified.1 parent 0592ecc commit 66a1cd2
1 file changed
+23
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
0 commit comments