()
| 1892 | |
| 1893 | |
| 1894 | def test_find_check_this_arg(): |
| 1895 | items = ['Four', 'Three', 'One'] |
| 1896 | result = [None] |
| 1897 | pm.eval( |
| 1898 | """ |
| 1899 | (result, arr) => { |
| 1900 | class Counter { |
| 1901 | constructor() |
| 1902 | { |
| 1903 | this.count = 0; |
| 1904 | } |
| 1905 | add(array) { |
| 1906 | array.find(function countEntry(entry) { ++this.count; }, this); |
| 1907 | } |
| 1908 | } |
| 1909 | const obj = new Counter(); |
| 1910 | obj.add(arr); |
| 1911 | result[0] = obj.count; |
| 1912 | } |
| 1913 | """ |
| 1914 | )(result, items) |
| 1915 | assert result == [3] |
| 1916 | |
| 1917 | |
| 1918 | def test_find_with_python_function(): |
nothing calls this directly
no outgoing calls
no test coverage detected