()
| 1245 | |
| 1246 | |
| 1247 | def test_map_self_jsfunction(): |
| 1248 | items = ['Four', 'Three', 'One'] |
| 1249 | |
| 1250 | result = pm.eval(""" |
| 1251 | (arr) => { |
| 1252 | function increment(element, index, array) { |
| 1253 | this.count++ |
| 1254 | } |
| 1255 | let jsObj = {count: 0} |
| 1256 | arr.map(increment, jsObj); |
| 1257 | return jsObj.count; |
| 1258 | } |
| 1259 | """)(items) |
| 1260 | assert result == 3 |
| 1261 | |
| 1262 | # filter |
| 1263 |
nothing calls this directly
no outgoing calls
no test coverage detected