You might have to redesign the find
like this
geoSpatialRepository.find = function(callBackFunction) {
Location.find({}).exec(callBackFunction);
}
And then you need to invoke it, from the test case, like this
it("should find the data present in location repository", function() {
//call
locationsRepository.find(function(error, data) {
console.log("ACTUAL ********************" + (JSON.stringify(actual)))
//assertion
expect(actual).deep.equals(data);
});
});
Now, the function you pass as a parameter to find
will get the actual data
. You can compare the data
and actual
in that function.