Skip to content

Commit

Permalink
fix: mapReduce test
Browse files Browse the repository at this point in the history
  • Loading branch information
RagibHasin committed May 17, 2017
1 parent a53a28e commit e98d541
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"build": "tsc",
"pretest": "npm run build",
"prepublish": "npm run build",
"test": "mocha --opts test/mocha.opts dist/test",
"test": "mocha --opts test/mocha.opts dist/test/*.js && mocha --opts test/mocha.opts dist/test",
"coverage": "istanbul cover node_modules/mocha/bin/_mocha -- --opts test/mocha.opts dist/test",
"postcoverage": "npm run coverage:remap:lcov",
"coverage:remap:lcov": "remap-istanbul -i coverage/coverage.json -o coverage/lcov.info -t lcovonly",
Expand Down
11 changes: 4 additions & 7 deletions test/MapReduce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ describe("Model", () => {
});

it("should correctly map and reduce with model", () => {
let t = model.mapReduce(MapReducedInstance, { out:{replace:'mapReduced'}, query: { status: "A" } }).then(()=>{
let t = model.mapReduce(MapReducedInstance, {
out: {
replace: "mapReduced"
}, query: { status: "A" } }).then(() => {
let reducedModel = new Iridium.Model<Iridium.MapReducedDocument<string, number>, MapReducedInstance>(core, MapReducedInstance);
return reducedModel.find().toArray()
})
t.then(instances => {
instances.forEach((val, i, arr) => { console.log(JSON.stringify(val)) });
})
return chai.expect(t).to.eventually.exist.and.have.length(2);
});

Expand All @@ -81,9 +81,6 @@ describe("Model", () => {
return sum;
}
}, { out: { inline: 1 }, query: { status: "A" } })
t.then(instances => {
instances.forEach((val, i, arr) => { console.log(JSON.stringify(val)) });
})
return chai.expect(t).to.eventually.exist.and.have.length(2);
});

Expand Down

0 comments on commit e98d541

Please sign in to comment.