Fix frontend tests

This commit is contained in:
Michael Mayer 2019-05-20 20:06:26 +02:00
parent 68b79081b3
commit 6670bb30de
5 changed files with 13 additions and 8 deletions

5
.gitignore vendored
View file

@ -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

View file

@ -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

View file

@ -28,7 +28,7 @@ module.exports = (config) => {
reporters: ["progress", "html"],
htmlReporter: {
outputFile: "tests/unit/result.html",
outputFile: "tests/unit.html",
},
webpack: {

View file

@ -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": [

View file

@ -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', () => {
}
);
});
});
});