diff --git a/.dockerignore b/.dockerignore index 3c3629e64..f05b1f265 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ node_modules +test diff --git a/.gitignore b/.gitignore index 2ec55accd..777dcc7f9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,13 +3,13 @@ npm-debug.log* dist !dist/coral-admin dist/coral-admin/bundle.js -tests/e2e/reports +test/e2e/reports .DS_Store *.iml *.swp dump.rdb .env -gaba.cfg +*.cfg .idea/ coverage/ yarn.lock diff --git a/.nodemon.json b/.nodemon.json index 834e6c054..4289167f7 100644 --- a/.nodemon.json +++ b/.nodemon.json @@ -1,4 +1,4 @@ { "verbose": true, - "ignore": ["tests/*", "client/*", "dist/*"] + "ignore": ["test/*", "client/*", "dist/*"] } diff --git a/package.json b/package.json index 52c49c156..7d4933524 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,9 @@ "build-watch": "NODE_ENV=development webpack --config webpack.config.dev.js --watch", "lint": "eslint bin/* .", "lint-fix": "eslint bin/* . --fix", - "test": "TEST_MODE=unit NODE_ENV=test mocha --compilers js:babel-core/register tests/helpers/*.js --require ignore-styles --recursive tests", - "test-watch": "TEST_MODE=unit NODE_ENV=test mocha --compilers js:babel-core/register --recursive -w tests", + "test": "TEST_MODE=unit NODE_ENV=test mocha", + "test-watch": "TEST_MODE=unit NODE_ENV=test mocha -w", + "test-cover": "TEST_MODE=unit NODE_ENV=test istanbul cover _mocha --report text --check-coverage -- -R spec", "pree2e": "NODE_ENV=test scripts/pree2e.sh", "e2e": "NODE_ENV=test nightwatch", "embed-start": "NODE_ENV=development npm run build && ./bin/cli serve --jobs", @@ -122,6 +123,7 @@ "ignore-styles": "^5.0.1", "immutable": "^3.8.1", "imports-loader": "^0.6.5", + "istanbul": "^1.1.0-alpha.1", "jsdom": "^9.8.3", "json-loader": "^0.5.4", "keymaster": "^1.6.2", diff --git a/tests/.eslintrc.json b/test/.eslintrc.json similarity index 100% rename from tests/.eslintrc.json rename to test/.eslintrc.json diff --git a/tests/client/.eslintrc.json b/test/client/.eslintrc.json similarity index 100% rename from tests/client/.eslintrc.json rename to test/client/.eslintrc.json diff --git a/tests/client/coral-admin/actions/assets.js b/test/client/coral-admin/actions/assets.js similarity index 100% rename from tests/client/coral-admin/actions/assets.js rename to test/client/coral-admin/actions/assets.js diff --git a/tests/client/coral-admin/reducers/assets.js b/test/client/coral-admin/reducers/assets.js similarity index 100% rename from tests/client/coral-admin/reducers/assets.js rename to test/client/coral-admin/reducers/assets.js diff --git a/tests/client/coral-framework/store/itemActions.js b/test/client/coral-framework/store/itemActions.js similarity index 100% rename from tests/client/coral-framework/store/itemActions.js rename to test/client/coral-framework/store/itemActions.js diff --git a/tests/client/coral-framework/store/itemReducer.js b/test/client/coral-framework/store/itemReducer.js similarity index 100% rename from tests/client/coral-framework/store/itemReducer.js rename to test/client/coral-framework/store/itemReducer.js diff --git a/tests/client/coral-framework/store/notificationReducer.spec.js b/test/client/coral-framework/store/notificationReducer.spec.js similarity index 100% rename from tests/client/coral-framework/store/notificationReducer.spec.js rename to test/client/coral-framework/store/notificationReducer.spec.js diff --git a/tests/client/coral-plugin-history/Comment.spec.js b/test/client/coral-plugin-history/Comment.spec.js similarity index 100% rename from tests/client/coral-plugin-history/Comment.spec.js rename to test/client/coral-plugin-history/Comment.spec.js diff --git a/tests/client/coral-plugin-history/CommentHistory.spec.js b/test/client/coral-plugin-history/CommentHistory.spec.js similarity index 100% rename from tests/client/coral-plugin-history/CommentHistory.spec.js rename to test/client/coral-plugin-history/CommentHistory.spec.js diff --git a/tests/e2e/globals.js b/test/e2e/globals.js similarity index 100% rename from tests/e2e/globals.js rename to test/e2e/globals.js diff --git a/tests/e2e/mocks.js b/test/e2e/mocks.js similarity index 100% rename from tests/e2e/mocks.js rename to test/e2e/mocks.js diff --git a/tests/e2e/pages/adminPage.js b/test/e2e/pages/adminPage.js similarity index 100% rename from tests/e2e/pages/adminPage.js rename to test/e2e/pages/adminPage.js diff --git a/tests/e2e/pages/embedStreamPage.js b/test/e2e/pages/embedStreamPage.js similarity index 100% rename from tests/e2e/pages/embedStreamPage.js rename to test/e2e/pages/embedStreamPage.js diff --git a/tests/e2e/tests/00_AppTest.js b/test/e2e/tests/00_AppTest.js similarity index 100% rename from tests/e2e/tests/00_AppTest.js rename to test/e2e/tests/00_AppTest.js diff --git a/tests/e2e/tests/01_EmbedStreamTest.js b/test/e2e/tests/01_EmbedStreamTest.js similarity index 100% rename from tests/e2e/tests/01_EmbedStreamTest.js rename to test/e2e/tests/01_EmbedStreamTest.js diff --git a/tests/e2e/tests/Admin/LoginTest.js b/test/e2e/tests/Admin/LoginTest.js similarity index 100% rename from tests/e2e/tests/Admin/LoginTest.js rename to test/e2e/tests/Admin/LoginTest.js diff --git a/tests/e2e/tests/Commenter/FlagCommentTest.js b/test/e2e/tests/Commenter/FlagCommentTest.js similarity index 100% rename from tests/e2e/tests/Commenter/FlagCommentTest.js rename to test/e2e/tests/Commenter/FlagCommentTest.js diff --git a/tests/e2e/tests/Commenter/FlagUsernameTest.js b/test/e2e/tests/Commenter/FlagUsernameTest.js similarity index 100% rename from tests/e2e/tests/Commenter/FlagUsernameTest.js rename to test/e2e/tests/Commenter/FlagUsernameTest.js diff --git a/tests/e2e/tests/Commenter/LikeCommentTest.js b/test/e2e/tests/Commenter/LikeCommentTest.js similarity index 100% rename from tests/e2e/tests/Commenter/LikeCommentTest.js rename to test/e2e/tests/Commenter/LikeCommentTest.js diff --git a/tests/e2e/tests/Commenter/LoginTest.js b/test/e2e/tests/Commenter/LoginTest.js similarity index 100% rename from tests/e2e/tests/Commenter/LoginTest.js rename to test/e2e/tests/Commenter/LoginTest.js diff --git a/tests/e2e/tests/Commenter/PermalinkTest.js b/test/e2e/tests/Commenter/PermalinkTest.js similarity index 100% rename from tests/e2e/tests/Commenter/PermalinkTest.js rename to test/e2e/tests/Commenter/PermalinkTest.js diff --git a/tests/e2e/tests/Commenter/PostComment.js b/test/e2e/tests/Commenter/PostComment.js similarity index 100% rename from tests/e2e/tests/Commenter/PostComment.js rename to test/e2e/tests/Commenter/PostComment.js diff --git a/tests/e2e/tests/EmbedStreamTests.js b/test/e2e/tests/EmbedStreamTests.js similarity index 100% rename from tests/e2e/tests/EmbedStreamTests.js rename to test/e2e/tests/EmbedStreamTests.js diff --git a/tests/e2e/tests/Moderator/LoginTest.js b/test/e2e/tests/Moderator/LoginTest.js similarity index 100% rename from tests/e2e/tests/Moderator/LoginTest.js rename to test/e2e/tests/Moderator/LoginTest.js diff --git a/tests/e2e/tests/Visitor/FlagCommentTest.js b/test/e2e/tests/Visitor/FlagCommentTest.js similarity index 100% rename from tests/e2e/tests/Visitor/FlagCommentTest.js rename to test/e2e/tests/Visitor/FlagCommentTest.js diff --git a/tests/e2e/tests/Visitor/LikeCommentTest.js b/test/e2e/tests/Visitor/LikeCommentTest.js similarity index 100% rename from tests/e2e/tests/Visitor/LikeCommentTest.js rename to test/e2e/tests/Visitor/LikeCommentTest.js diff --git a/tests/e2e/tests/Visitor/SignUpTest.js b/test/e2e/tests/Visitor/SignUpTest.js similarity index 100% rename from tests/e2e/tests/Visitor/SignUpTest.js rename to test/e2e/tests/Visitor/SignUpTest.js diff --git a/tests/helpers/browser.js b/test/helpers/browser.js similarity index 100% rename from tests/helpers/browser.js rename to test/helpers/browser.js diff --git a/tests/helpers/index.test.html b/test/helpers/index.test.html similarity index 100% rename from tests/helpers/index.test.html rename to test/helpers/index.test.html diff --git a/tests/helpers/mongoose.js b/test/helpers/mongoose.js similarity index 100% rename from tests/helpers/mongoose.js rename to test/helpers/mongoose.js diff --git a/tests/kue.js b/test/kue.js similarity index 100% rename from tests/kue.js rename to test/kue.js diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100644 index 000000000..a159ae7aa --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1,7 @@ +test/helpers/*.js +test +--compilers js:babel-core/register +--require ignore-styles +--recursive +--colors +--sort diff --git a/tests/models/action.js b/test/models/action.js similarity index 100% rename from tests/models/action.js rename to test/models/action.js diff --git a/tests/models/asset.js b/test/models/asset.js similarity index 100% rename from tests/models/asset.js rename to test/models/asset.js diff --git a/tests/models/comment.js b/test/models/comment.js similarity index 100% rename from tests/models/comment.js rename to test/models/comment.js diff --git a/tests/models/setting.js b/test/models/setting.js similarity index 100% rename from tests/models/setting.js rename to test/models/setting.js diff --git a/tests/models/user.js b/test/models/user.js similarity index 100% rename from tests/models/user.js rename to test/models/user.js diff --git a/tests/mongoose.js b/test/mongoose.js similarity index 100% rename from tests/mongoose.js rename to test/mongoose.js diff --git a/tests/passport.js b/test/passport.js similarity index 100% rename from tests/passport.js rename to test/passport.js diff --git a/tests/routes/api/assets/index.js b/test/routes/api/assets/index.js similarity index 100% rename from tests/routes/api/assets/index.js rename to test/routes/api/assets/index.js diff --git a/tests/routes/api/auth/index.js b/test/routes/api/auth/index.js similarity index 100% rename from tests/routes/api/auth/index.js rename to test/routes/api/auth/index.js diff --git a/tests/routes/api/comments/index.js b/test/routes/api/comments/index.js similarity index 100% rename from tests/routes/api/comments/index.js rename to test/routes/api/comments/index.js diff --git a/tests/routes/api/queue/index.js b/test/routes/api/queue/index.js similarity index 100% rename from tests/routes/api/queue/index.js rename to test/routes/api/queue/index.js diff --git a/tests/routes/api/settings/index.js b/test/routes/api/settings/index.js similarity index 100% rename from tests/routes/api/settings/index.js rename to test/routes/api/settings/index.js diff --git a/tests/routes/api/stream/index.js b/test/routes/api/stream/index.js similarity index 100% rename from tests/routes/api/stream/index.js rename to test/routes/api/stream/index.js diff --git a/tests/routes/api/user/index.js b/test/routes/api/user/index.js similarity index 100% rename from tests/routes/api/user/index.js rename to test/routes/api/user/index.js diff --git a/tests/services/scraper.js b/test/services/scraper.js similarity index 100% rename from tests/services/scraper.js rename to test/services/scraper.js diff --git a/tests/services/wordlist.js b/test/services/wordlist.js similarity index 100% rename from tests/services/wordlist.js rename to test/services/wordlist.js