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:
parent
b8201a2731
commit
d08a4c1ccc
5 changed files with 2310 additions and 32 deletions
2
Makefile
2
Makefile
|
@ -157,7 +157,7 @@ ifneq ($(HAS_SERVER),)
|
||||||
$(GO) test -v $(GO_TEST_FLAGS) ./server/...
|
$(GO) test -v $(GO_TEST_FLAGS) ./server/...
|
||||||
endif
|
endif
|
||||||
ifneq ($(HAS_WEBAPP),)
|
ifneq ($(HAS_WEBAPP),)
|
||||||
cd webapp && $(NPM) run fix;
|
cd webapp && $(NPM) run fix && $(NPM) run test;
|
||||||
endif
|
endif
|
||||||
|
|
||||||
## Creates a coverage report for the server code.
|
## Creates a coverage report for the server code.
|
||||||
|
|
4
webapp/.babelrc
Normal file
4
webapp/.babelrc
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
presets: ['@babel/preset-env', '@babel/preset-react']
|
||||||
|
}
|
||||||
|
|
2326
webapp/package-lock.json
generated
2326
webapp/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -6,7 +6,8 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --mode=production",
|
"build": "webpack --mode=production",
|
||||||
"lint": "eslint --ignore-pattern node_modules --ignore-pattern dist --ext .js --ext .jsx . --quiet",
|
"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": "",
|
"author": "",
|
||||||
"license": "",
|
"license": "",
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
"eslint-plugin-import": "2.18.0",
|
"eslint-plugin-import": "2.18.0",
|
||||||
"eslint-plugin-react": "7.14.2",
|
"eslint-plugin-react": "7.14.2",
|
||||||
"file-loader": "4.0.0",
|
"file-loader": "4.0.0",
|
||||||
|
"jest": "^24.8.0",
|
||||||
"webpack": "4.35.0",
|
"webpack": "4.35.0",
|
||||||
"webpack-cli": "3.3.5"
|
"webpack-cli": "3.3.5"
|
||||||
},
|
},
|
||||||
|
|
6
webapp/src/manifest.test.js
Normal file
6
webapp/src/manifest.test.js
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import {id, version} from './manifest';
|
||||||
|
|
||||||
|
test('Plugin id and version are defined', () => {
|
||||||
|
expect(id).toBeDefined();
|
||||||
|
expect(version).toBeDefined();
|
||||||
|
});
|
Reference in a new issue