()
| 2205 | |
| 2206 | |
| 2207 | def test_flatMap_equivalence(): |
| 2208 | items = [1, 2, 1] |
| 2209 | result = [0] |
| 2210 | result2 = [0] |
| 2211 | pm.eval("(result, arr) => {result[0] = arr.flatMap((num) => (num === 2 ? [2, 2] : 1))}")(result, items) |
| 2212 | pm.eval("(result, arr) => {result[0] = arr.map((num) => (num === 2 ? [2, 2] : 1)).flat()}")(result2, items) |
| 2213 | assert result[0] == result2[0] |
| 2214 | |
| 2215 | |
| 2216 | def test_flatMap_check_index(): |
nothing calls this directly
no outgoing calls
no test coverage detected