From 6bb9b0fe7840642ba7179adb4044ef00707d4645 Mon Sep 17 00:00:00 2001 From: Andrew Chalkley Date: Sun, 8 Apr 2018 21:44:14 -0700 Subject: [PATCH] Updated mocha to close automatically --- package.json | 4 ++-- test/commands/test-new.js | 6 +++--- test/unit/test-ports.js | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 09f8520..6f7d402 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,9 @@ "thingssdk": "./bin/thingssdk.js" }, "scripts": { - "test": "mocha --recursive", + "test": "mocha --recursive --timeout 5000 --exit", "combine-coverage": "node ./scripts/coverage_combine", - "test:coverage": "rimraf coverage && istanbul cover --report=none --print=none --include-pid node_modules/mocha/bin/_mocha -- --recursive && npm run combine-coverage" + "test:coverage": "rimraf coverage && istanbul cover --report=none --print=none --include-pid node_modules/mocha/bin/_mocha -- --recursive --timeout 5000 --exit && npm run combine-coverage" }, "repository": { "type": "git", diff --git a/test/commands/test-new.js b/test/commands/test-new.js index 177a9ee..6bddc09 100644 --- a/test/commands/test-new.js +++ b/test/commands/test-new.js @@ -124,7 +124,7 @@ describe("thingssdk new", () => { assert.notEqual(fs.readFileSync(mainPath, "utf-8"), newFileContents); done(); }); - }).timeout(5000); + }); it("should abort if n", done => { assert.equal(fs.readFileSync(mainPath, "utf-8"), newFileContents); @@ -138,7 +138,7 @@ describe("thingssdk new", () => { assert.equal(fs.readFileSync(mainPath, "utf-8"), newFileContents); done(); }); - }).timeout(5000); + }); it("should abort and error if y or n not pressent", done => { assert.equal(fs.readFileSync(mainPath, "utf-8"), newFileContents); @@ -152,7 +152,7 @@ describe("thingssdk new", () => { assert.equal(fs.readFileSync(mainPath, "utf-8"), newFileContents); done(); }); - }).timeout(5000); + }); }); describe("if arguments with tildes in the path are passed", () => { diff --git a/test/unit/test-ports.js b/test/unit/test-ports.js index eb74e27..c85dd8a 100644 --- a/test/unit/test-ports.js +++ b/test/unit/test-ports.js @@ -75,6 +75,5 @@ describe("function getPorts()", () => { assert.isNull(err); done(); }); - }).timeout(4000); - + }); }); \ No newline at end of file