I would like to know the best way to test (with jasmine) a filter with this scenario:
function districtFilter(city, array) {
var districtFound = array.filter(function(a) {
return a.id !== city.id;
});
return districtFound;
}
I would like to know the best way to test (with jasmine) a filter with this scenario:
function districtFilter(city, array) {
var districtFound = array.filter(function(a) {
return a.id !== city.id;
});
return districtFound;
}
var array = [
{
id: 1,
city: "Washington"
},
{
id: 2,
city: "Chicago"
},
{
id: 3,
city: "New York"
}];
var city = {
id: 1,
city: "Washington"
};
console.log(districtFilter(city, array));