-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from cowprotocol/2/unit-tests
Add missing unit tests
- Loading branch information
Showing
10 changed files
with
2,737 additions
and
2,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
name: Unit tests | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
name: Unit tests & Coverage | ||
on: [push, pull_request] | ||
|
||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
|
||
jobs: | ||
test: | ||
|
@@ -35,7 +34,7 @@ jobs: | |
rm -rf .yarncache | ||
yarn cache clean | ||
- name: Run tests | ||
run: 'npm run test' | ||
run: yarn run test:coverage | ||
|
||
- name: Comment in failing tests | ||
uses: mattallty/[email protected] | ||
|
@@ -45,3 +44,9 @@ jobs: | |
with: | ||
test-command: 'echo unit tests already executed' | ||
coverage-comment: false | ||
|
||
- name: Coveralls Report | ||
uses: coverallsapp/[email protected] | ||
if: success() || failure() | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
node_modules | ||
dist | ||
coverage | ||
.coveralls.yml | ||
jest.results.json | ||
.idea | ||
*.iml | ||
*.iml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import fetchMock from 'jest-fetch-mock' | ||
import log from 'loglevel' | ||
|
||
jest.setMock('cross-fetch', fetchMock) | ||
|
||
global.window = global | ||
|
||
log.info = jest.fn | ||
log.debug = jest.fn | ||
log.error = jest.fn | ||
log.setLevel = jest.fn |
Oops, something went wrong.