()
| 2180 | |
| 2181 | |
| 2182 | def test_flatMap_with_js_array(): |
| 2183 | items = [1, 2, 2, 1] |
| 2184 | result = [0] |
| 2185 | pm.eval("(result, arr) => {arr[1] = [10,11]; result[0] = arr.flatMap((num) => (num === 2 ? [2, 2] : 1))}")( |
| 2186 | result, items) |
| 2187 | assert items == [1, [10, 11], 2, 1] |
| 2188 | assert result[0] == [1, 1, 2, 2, 1] |
| 2189 | |
| 2190 | |
| 2191 | def test_flatMap_no_replace(): |
nothing calls this directly
no outgoing calls
no test coverage detected