MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / test_flatMap_with_js_array

Function test_flatMap_with_js_array

tests/python/test_arrays.py:2182–2188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2180
2181
2182def 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
2191def test_flatMap_no_replace():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected