Skip to content

Commit

Permalink
chore: setup jest coverage + ci integration(codecov.io)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodmax committed Nov 19, 2019
1 parent 0e6a22c commit a4590d6
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ trim_trailing_whitespace = true
[package.json,*.yml]
indent_size = 2

[*.yml]
indent_size = 2


max_line_length = 100
14 changes: 11 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}

- name: use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: npm install global packages
run: npm install -g codecov

- name: npm ci
run: npm ci
- name: npm run pre-push(lint/build/e2e)
run: npm run pre-push
- name: lint, test, build, then e2e
run: npm run pre-push

- name: send coverage to codecov.io
run: codecov --token="${{ secrets.CODECOV_IO_TOKEN }}" --branch="${GITHUB_REF#refs/heads/}"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode/
node_modules/
dist/
dist/
reports/
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Actions Status](https://github.com/rodmax/react-playground/workflows/ci/badge.svg)](https://github.com/rodmax/react-playground/actions) [![Greenkeeper badge](https://badges.greenkeeper.io/rodmax/react-playground.svg)](https://greenkeeper.io/)

[![codecov](https://codecov.io/gh/rodmax/react-playground/branch/master/graph/badge.svg)](https://codecov.io/gh/rodmax/react-playground)

The main purpose of this project is to study web applications development based on react stack

Expand All @@ -14,7 +15,8 @@ The main purpose of this project is to study web applications development based
- [x] Sass + PostCSS(autoprefixer and friends)
- Quality:
- [x] CI: base on [github actions](https://github.com/rodmax/react-playground/actions)
- [ ] CI: code coverage badge
- [ ] [CI: code coverage](https://codecov.io/gh/rodmax/react-playground)
- [ ] [CI: sonar cloud analyzer](https://sonarcloud.io/dashboard?id=rodmax_react-playground)
- [x] E2E testing: testcafe
- [x] unit & international testing: jest + testing-library
- [ ] jest: code coverage
Expand Down
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @type { jest.ProjectConfig }
* @type { jest.GlobalConfig }
*/
module.exports = {
roots: ['src'],
Expand All @@ -16,4 +16,6 @@ module.exports = {
tsConfig: './src/tsconfig.json',
},
},
collectCoverageFrom: ['./src/app/**'],
coverageDirectory: './reports',
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint:all": "run-p -ln eslint stylelint",
"prettier:fix": "prettier --check --write './*.js'",
"jest:watch": "jest --watch",
"jest": "jest",
"jest": "jest --coverage",
"testcafe:prod": "E2E_MODE=prod testcafe --app 'npm run app:serve'",
"testcafe:live": "E2E_MODE=dev testcafe chrome --live",
"pre-commit": "run-p -ln lint:all",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
"types": [], /* Type declaration files to be included in compilation. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just type checking. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
Expand Down

0 comments on commit a4590d6

Please sign in to comment.