Add a task of webapp test (#51)

* Add a task of webapp test

* Flesh out tests

* Simplify test case

* Remove unnecessary dependency

* Fix style

* Add dependency

* Add trainling newline
This commit is contained in:
Yusuke Nemoto 2019-07-13 01:07:20 +09:00 committed by Maria A Nunez
parent b8201a2731
commit d08a4c1ccc
5 changed files with 2310 additions and 32 deletions

View file

@ -157,7 +157,7 @@ ifneq ($(HAS_SERVER),)
$(GO) test -v $(GO_TEST_FLAGS) ./server/...
endif
ifneq ($(HAS_WEBAPP),)
cd webapp && $(NPM) run fix;
cd webapp && $(NPM) run fix && $(NPM) run test;
endif
## Creates a coverage report for the server code.

4
webapp/.babelrc Normal file
View file

@ -0,0 +1,4 @@
{
presets: ['@babel/preset-env', '@babel/preset-react']
}

2326
webapp/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,8 @@
"scripts": {
"build": "webpack --mode=production",
"lint": "eslint --ignore-pattern node_modules --ignore-pattern dist --ext .js --ext .jsx . --quiet",
"fix": "eslint --ignore-pattern node_modules --ignore-pattern dist --ext .js --ext .jsx . --quiet --fix"
"fix": "eslint --ignore-pattern node_modules --ignore-pattern dist --ext .js --ext .jsx . --quiet --fix",
"test": "jest --forceExit --detectOpenHandles --verbose"
},
"author": "",
"license": "",
@ -26,6 +27,7 @@
"eslint-plugin-import": "2.18.0",
"eslint-plugin-react": "7.14.2",
"file-loader": "4.0.0",
"jest": "^24.8.0",
"webpack": "4.35.0",
"webpack-cli": "3.3.5"
},

View file

@ -0,0 +1,6 @@
import {id, version} from './manifest';
test('Plugin id and version are defined', () => {
expect(id).toBeDefined();
expect(version).toBeDefined();
});