()
| 1139 | |
| 1140 | |
| 1141 | def test_map_check_this_arg(): |
| 1142 | items = ['Four', 'Three', 'One'] |
| 1143 | result = [None] |
| 1144 | pm.eval( |
| 1145 | """ |
| 1146 | (result, arr) => { |
| 1147 | class Counter { |
| 1148 | constructor() |
| 1149 | { |
| 1150 | this.count = 0; |
| 1151 | } |
| 1152 | add(array) { |
| 1153 | array.map(function countEntry(entry) { ++this.count; }, this); |
| 1154 | } |
| 1155 | } |
| 1156 | const obj = new Counter(); |
| 1157 | obj.add(arr); |
| 1158 | result[0] = obj.count; |
| 1159 | } |
| 1160 | """ |
| 1161 | )(result, items) |
| 1162 | assert result == [3] |
| 1163 | |
| 1164 | |
| 1165 | def test_map_too_few_args(): |
nothing calls this directly
no outgoing calls
no test coverage detected