From e98d541c2acb512e589a836fae080b58c34f8fa1 Mon Sep 17 00:00:00 2001 From: Muhammad Ragib Hasin Date: Wed, 17 May 2017 15:29:21 +0600 Subject: [PATCH] fix: mapReduce test --- package.json | 2 +- test/MapReduce.ts | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 2a02e12..6b88575 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/MapReduce.ts b/test/MapReduce.ts index a594dca..80d9b4e 100644 --- a/test/MapReduce.ts +++ b/test/MapReduce.ts @@ -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, 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); }); @@ -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); });