Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Add test coverage #75

Merged
merged 3 commits into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .deps/EXCLUDED.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
| `select-hose@2.0.0` | [CQ22386](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22386) |
| `sshpk@1.16.1` | [CQ22386](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22386) |
| `stealthy-require@1.1.1` | [CQ22386](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22386) |
| `typescript@3.9.5` | [CQ22386](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22386) |
| `typescript@3.9.7` | [CQ22386](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22386) |
| `watchpack-chokidar2@2.0.0` | [CQ22386](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22386) |
| `wbuf@1.7.3` | [CQ22386](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22386) |
| `chokidar@2.1.8` | [CQ21965](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=21965) |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
- name: Build
run: yarn compile
- name: Run unit tests
run: yarn test --runInBand
run: yarn test --coverage --runInBand
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ build/
tests/e2e/dist/
tests/e2e/node_modules/
tests/e2e/report/

coverage
25 changes: 25 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,29 @@ module.exports = {
},
maxWorkers: 4,
setupFilesAfterEnv: ['./jest.setup.ts'],
collectCoverage: false,
collectCoverageFrom: [
'src/**/*.{ts,tsx}',

'!src/**/*.d.{ts,tsx}',
'!src/**/*.config.ts',
'!src/**/*.enum.ts',
'!src/index.tsx',
'!src/App.tsx',
'!src/Routes.tsx',
],
coverageDirectory: './coverage',
coverageReporters: [
['html', { coverageDirectory: './coverage_html' }],
//['html-spa', {coverageDirectory: './coverage_html-spa' }],
'text-summary'
],
coverageThreshold: {
global: {
statements: 29,
branches: 18,
functions: 24,
lines: 29,
}
},
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"stylelint:fix": "stylelint */**/*.css --fix",
"serve:prod": "webpack-dev-server --color --disable-host-check --config webpack.config.prod-dev.js",
"test": "jest",
"test:coverage": "jest --coverage",
"test:watch": "jest --watch",
"licenseCheck:prepare": "license-tool/build.sh",
"licenseCheck:run": "license-tool/run.sh"
Expand Down
3 changes: 1 addition & 2 deletions src/containers/IdeLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,5 @@ const connector = connect(
mapStateToProps,
WorkspaceStore.actionCreators,
);
// need a different type for testing
type MappedProps = ConnectedProps<typeof connector> | any
type MappedProps = ConnectedProps<typeof connector> | any;
export default connector(IdeLoader);