The ability to specify a function for the test
property of the parameter map appeared in 1.26. In the previous version 1.24 this was not possible. From your comments you're running 1.24, hence the error.
FWIW, here's the detail from sap/ui/model/Filter.js in 1.24 vs 1.26:
1.24:
/**
* Constructor for Filter
* You can either pass an object with the filter parameters or use the function arguments
*
* Using object:
* new sap.ui.model.Filter({
* path: "...",
* operator: "...",
* value1: "...",
* value2: "..."
* })
*
* OR:
* new sap.ui.model.Filter({
* filters: [...],
* and: true|false
* })
1.26:
/**
* Constructor for Filter
* You can either pass an object with the filter parameters or use the function arguments
*
* Using object:
* new sap.ui.model.Filter({
* path: "...",
* operator: "...",
* value1: "...",
* value2: "..."
* })
*
* OR:
* new sap.ui.model.Filter({
* path: "...",
* test: function(oValue) {
* }
* })
*
* OR:
* new sap.ui.model.Filter({
* filters: [...],
* and: true|false
* })