Skip to content

Commit d3ff1b2

Browse files
eterna2Jeffwan
authored andcommitted
[Frontend] unit tests for node server (kubeflow#2745)
* Add unit tests for aws-helper and minio-helper. * Break up server.ts into app.ts and handlers/*.ts so that unit test can be written more easily. * update @types/node because of microsoft/TypeScript#32333 * upgrade kubernete-client version to be compatible with new @types/node version * fix bug: AWSInstanceProfileCredentials.profile() returns a promise not a string * remove I prefix from interfaces. minor fixes on lint errors. * fix format errors * Added more unit tests, and minor fixes. * Fix comment: GKS should be GKE * use jest.resetAllMocks instead of reset each mock individually * fix format for helper test
1 parent e6f0f61 commit d3ff1b2

26 files changed

+5095
-2084
lines changed

frontend/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ backstop_data/bitmaps_test/
2424
npm-debug.log*
2525
yarn-debug.log*
2626
yarn-error.log*
27+
28+
# coverage reports
29+
coverage
30+
31+
# vscode
32+
.vscode

frontend/package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@
5555
"start:proxy-standalone-and-server": "./start-proxy-standalone-and-server.sh",
5656
"start": "react-scripts-ts start",
5757
"test": "react-scripts-ts test --env=jsdom",
58+
"test:server": "cd ./server && npm test && cd ..",
5859
"test:coverage": "npm test -- --env=jsdom --coverage",
5960
"test:ci": "npm run format:check && npm run lint && npm run test:coverage",
60-
"test:ci:prow": "npm set unsafe-perm true && npm ci && npm run test:ci && ./scripts/report-coveralls.sh",
61+
"test:ci:prow": "npm set unsafe-perm true && npm ci && npm run test:ci && ./scripts/report-coveralls.sh && npm run test:server",
6162
"vr-approve": "backstop approve",
6263
"vr-test": "ts-node -O '{\"module\": \"commonjs\"}' backstop.ts"
6364
},
@@ -74,7 +75,7 @@
7475
"@types/js-yaml": "^3.11.2",
7576
"@types/lodash": ">=4.14.117",
7677
"@types/markdown-to-jsx": "^6.9.0",
77-
"@types/node": "^10.10.1",
78+
"@types/node": "^10.17.11",
7879
"@types/react": "^16.7.18",
7980
"@types/react-dom": "^16.0.7",
8081
"@types/react-router-dom": "^4.3.1",

0 commit comments

Comments
 (0)