()
| 1972 | |
| 1973 | |
| 1974 | def test_find_self_jsfunction(): |
| 1975 | items = ['Four', 'Three', 'One'] |
| 1976 | |
| 1977 | result = pm.eval(""" |
| 1978 | (arr) => { |
| 1979 | function increment(element, index, array) { |
| 1980 | this.count++; |
| 1981 | return false; |
| 1982 | } |
| 1983 | let jsObj = {count: 0} |
| 1984 | arr.find(increment, jsObj); |
| 1985 | return jsObj.count; |
| 1986 | } |
| 1987 | """)(items) |
| 1988 | assert result == 3 |
| 1989 | |
| 1990 | # findIndex |
| 1991 |
nothing calls this directly
no outgoing calls
no test coverage detected