From 157e9be6da02c09fd45f2fc375a740cc9364d932 Mon Sep 17 00:00:00 2001 From: HeeL Date: Wed, 28 Sep 2016 00:28:20 +0200 Subject: [PATCH 1/3] Update mocha and istanbul npm tasks - remove not needed relative paths to mocha and istanbul binaries - remove test-windows task because _mocha.cmd doesn't exist - extract mocha options to separate file - decrease timeout for single it-block form 10 seconds to 5 second --- package.json | 3 +-- tests/.mocha.opts | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 tests/.mocha.opts diff --git a/package.json b/package.json index 0582f20cb4..c415f0f03d 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,7 @@ "start": "node loader.js", "lint": "eslint --cache .", "pretest": "npm run lint", - "test": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- ./tests -t 10000", - "test-windows": "./node_modules/.bin/_mocha.cmd ./tests -t 10000" + "test": "istanbul cover _mocha tests" }, "dependencies": { "async": "~1.5.0", diff --git a/tests/.mocha.opts b/tests/.mocha.opts new file mode 100644 index 0000000000..5f4ab1a224 --- /dev/null +++ b/tests/.mocha.opts @@ -0,0 +1,2 @@ +--reporter dot +--timeout 5000 From 4c6a75d85cc105aa75b57f38113dbc30bb986cc1 Mon Sep 17 00:00:00 2001 From: HeeL Date: Wed, 28 Sep 2016 09:56:41 +0200 Subject: [PATCH 2/3] Rename tests folder to test to follow standards --- package.json | 2 +- {tests => test}/.jshintrc | 0 {tests => test}/categories.js | 0 {tests => test}/database.js | 0 {tests => test}/database/hash.js | 0 {tests => test}/database/keys.js | 0 {tests => test}/database/list.js | 0 {tests => test}/database/sets.js | 0 {tests => test}/database/sorted.js | 0 {tests => test}/groups.js | 0 {tests => test}/messaging.js | 0 tests/.mocha.opts => test/mocha.opts | 0 {tests => test}/mocks/databasemock.js | 0 {tests => test}/topics.js | 0 {tests => test}/translator-new.js | 0 {tests => test}/translator.js | 0 {tests => test}/user.js | 0 {tests => test}/utils.js | 0 18 files changed, 1 insertion(+), 1 deletion(-) rename {tests => test}/.jshintrc (100%) rename {tests => test}/categories.js (100%) rename {tests => test}/database.js (100%) rename {tests => test}/database/hash.js (100%) rename {tests => test}/database/keys.js (100%) rename {tests => test}/database/list.js (100%) rename {tests => test}/database/sets.js (100%) rename {tests => test}/database/sorted.js (100%) rename {tests => test}/groups.js (100%) rename {tests => test}/messaging.js (100%) rename tests/.mocha.opts => test/mocha.opts (100%) rename {tests => test}/mocks/databasemock.js (100%) rename {tests => test}/topics.js (100%) rename {tests => test}/translator-new.js (100%) rename {tests => test}/translator.js (100%) rename {tests => test}/user.js (100%) rename {tests => test}/utils.js (100%) diff --git a/package.json b/package.json index c415f0f03d..98bee1c2a6 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "start": "node loader.js", "lint": "eslint --cache .", "pretest": "npm run lint", - "test": "istanbul cover _mocha tests" + "test": "istanbul cover _mocha test" }, "dependencies": { "async": "~1.5.0", diff --git a/tests/.jshintrc b/test/.jshintrc similarity index 100% rename from tests/.jshintrc rename to test/.jshintrc diff --git a/tests/categories.js b/test/categories.js similarity index 100% rename from tests/categories.js rename to test/categories.js diff --git a/tests/database.js b/test/database.js similarity index 100% rename from tests/database.js rename to test/database.js diff --git a/tests/database/hash.js b/test/database/hash.js similarity index 100% rename from tests/database/hash.js rename to test/database/hash.js diff --git a/tests/database/keys.js b/test/database/keys.js similarity index 100% rename from tests/database/keys.js rename to test/database/keys.js diff --git a/tests/database/list.js b/test/database/list.js similarity index 100% rename from tests/database/list.js rename to test/database/list.js diff --git a/tests/database/sets.js b/test/database/sets.js similarity index 100% rename from tests/database/sets.js rename to test/database/sets.js diff --git a/tests/database/sorted.js b/test/database/sorted.js similarity index 100% rename from tests/database/sorted.js rename to test/database/sorted.js diff --git a/tests/groups.js b/test/groups.js similarity index 100% rename from tests/groups.js rename to test/groups.js diff --git a/tests/messaging.js b/test/messaging.js similarity index 100% rename from tests/messaging.js rename to test/messaging.js diff --git a/tests/.mocha.opts b/test/mocha.opts similarity index 100% rename from tests/.mocha.opts rename to test/mocha.opts diff --git a/tests/mocks/databasemock.js b/test/mocks/databasemock.js similarity index 100% rename from tests/mocks/databasemock.js rename to test/mocks/databasemock.js diff --git a/tests/topics.js b/test/topics.js similarity index 100% rename from tests/topics.js rename to test/topics.js diff --git a/tests/translator-new.js b/test/translator-new.js similarity index 100% rename from tests/translator-new.js rename to test/translator-new.js diff --git a/tests/translator.js b/test/translator.js similarity index 100% rename from tests/translator.js rename to test/translator.js diff --git a/tests/user.js b/test/user.js similarity index 100% rename from tests/user.js rename to test/user.js diff --git a/tests/utils.js b/test/utils.js similarity index 100% rename from tests/utils.js rename to test/utils.js From 3894dd644b568bd6c92c091f00f3333622596977 Mon Sep 17 00:00:00 2001 From: HeeL Date: Mon, 3 Oct 2016 01:41:54 +0200 Subject: [PATCH 3/3] Update mocha to the latest version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 98bee1c2a6..b25be410b9 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "grunt": "~0.4.5", "grunt-contrib-watch": "^1.0.0", "istanbul": "^0.4.2", - "mocha": "~1.13.0" + "mocha": "~3.1.0" }, "bugs": { "url": "https://github.com/NodeBB/NodeBB/issues"