Skip to content

Commit

Permalink
Merge pull request #31 from timmson/migrate-to-jest
Browse files Browse the repository at this point in the history
Migrate to jest
  • Loading branch information
timmson authored Jan 24, 2021
2 parents e81333e + b496cbd commit ade2774
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 2,912 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
"browser": true,
"commonjs": true,
"es6": true,
"mocha": true
"jest": true
},
"extends": [
"eslint:recommended"
Expand Down
31 changes: 25 additions & 6 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,41 @@ jobs:

strategy:
matrix:
node-version: [10.x]
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm i mocha nyc codecov -g
npm i

- name: Lint and coverage
run: |
npm i
npm run lint
npm run coverage && codecov
npm run coverage && npx codecov
env:
CI: true
CODECOV_TOKEN: 000c0032-edb5-4b49-a413-e98f16a5623d

- name: Lint and coverage
run: |
cd ./docs
npm i
npm run prod
env:
CI: true

- name: Commit files
run: |
git config --local user.email "loan-schedule[bot]@users.noreply.github.com"
git config --local user.name "loan-schedule[bot]"
git add -A
git diff-index --quiet HEAD || git commit -m "Compile App"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
*.iml
.idea/
node_modules/
.nyc_output
coverage.lcov
.idea
coverage
node_modules
3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
node_modules/

# Test & Coverage
.nyc_output/
coverage.lcov
coverage/
test/

# Git
Expand Down
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
coverageReporters: ["lcov"],
testMatch: ["**/test/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"]
};
Loading

0 comments on commit ade2774

Please # to comment.