diff --git a/.gitignore b/.gitignore index 6f1cda5e1..d9768797a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,9 @@ /node_modules /frontend/.eslintcache /frontend/node_modules/* -/frontend/tests/result.html +/frontend/tests/*.html +/frontend/tests/*.log +/frontend/tests/screenshots /assets/testdata /assets/backups /assets/tensorflow/nasnet @@ -46,4 +48,3 @@ Thumbs.db .tmp # Acceptance Test Screenshots -/frontend/tests/acceptance/screenshots \ No newline at end of file diff --git a/Makefile b/Makefile index 60572cc12..61b89c51f 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,10 @@ build-go: scripts/build.sh debug $(BINARY_NAME) test-js: (cd frontend && env NODE_ENV=development npm run test) +test-chromium: + (cd frontend && npm run test-chromium) +test-firefox: + (cd frontend && npm run test-firefox) test-go: go test -tags=slow -timeout 20m -v ./internal/... | scripts/colorize-tests.sh test-short: @@ -54,8 +58,6 @@ test-codecov: test-coverage: go test -tags=slow -timeout 30m -coverprofile=coverage.txt -covermode=atomic -v ./internal/... go tool cover -html=coverage.txt -o coverage.html -test-acceptance: - testcafe chromium:headless -S -s frontend/tests/screenshots frontend/tests/acceptance/ clean: rm -f $(BINARY_NAME) rm -f *.log diff --git a/frontend/karma.conf.js b/frontend/karma.conf.js index 2f2402076..15a5653d5 100644 --- a/frontend/karma.conf.js +++ b/frontend/karma.conf.js @@ -28,7 +28,7 @@ module.exports = (config) => { reporters: ["progress", "html"], htmlReporter: { - outputFile: "tests/unit/result.html", + outputFile: "tests/unit.html", }, webpack: { diff --git a/frontend/package.json b/frontend/package.json index 4f4484e56..a7caf8860 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,7 +9,9 @@ "build": "webpack --optimize-minimize", "lint": "eslint --cache src/ *.js", "fmt": "eslint --cache --fix src/ *.js", - "test": "karma start" + "test": "karma start", + "test-chromium": "testcafe chromium:headless -S -s tests/screenshots tests/acceptance", + "test-firefox": "testcafe firefox:headless -S -s tests/screenshots tests/acceptance" }, "babel": { "presets": [ diff --git a/frontend/tests/unit/common/api_test.js b/frontend/tests/unit/common/api_test.js index 3a5113b31..f9656e8ec 100644 --- a/frontend/tests/unit/common/api_test.js +++ b/frontend/tests/unit/common/api_test.js @@ -1,6 +1,6 @@ import assert from 'assert'; import Api from 'common/api'; -import MockAdapter from 'axios-mock-adapter/types'; +import MockAdapter from 'axios-mock-adapter'; const mock = new MockAdapter(Api); @@ -103,4 +103,4 @@ describe('common/api', () => { } ); }); -}); \ No newline at end of file +});