Skip to content

Commit

Permalink
feat: Coverage comments (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
yagopv authored Jul 4, 2023
1 parent a8a21b2 commit bd9eeda
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 9 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,31 @@ jobs:

- name: Test
run: yarn test

- name: Auth Kit coverage
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-path: packages/auth-kit
file: packages/auth-kit/coverage/lcov.info

- name: OnRamp Kit coverage
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-path: packages/onramp-kit
file: packages/onramp-kit/coverage/lcov.info

- name: Relay Kit coverage
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-path: packages/relay-kit
file: packages/relay-kit/coverage/lcov.info

- name: Api Kit coverage
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-path: packages/api-kit
file: packages/api-kit/coverage/lcov.info
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![license](https://img.shields.io/github/license/safe-global/safe-core-sdk)
![license](https://img.shields.io/github/license/safe-global/safe-core-sdk) [![Coverage Status](https://coveralls.io/repos/github/safe-global/safe-core-sdk/badge.svg?branch=main)](https://coveralls.io/github/safe-global/safe-core-sdk?branch=main)

![Safe_Logos_Core_SDK_Black](https://github.com/safe-global/safe-core-sdk/assets/6764315/b6f87103-540f-4d36-a108-56ee9eb4e919)

Expand Down
4 changes: 2 additions & 2 deletions packages/api-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
],
"scripts": {
"test:web3": "export TESTS_PATH=tests/endpoint && export ETH_LIB=web3 && nyc hardhat test",
"test:ethers": "export TESTS_PATH=tests/endpoint && export ETH_LIB=ethers && nyc hardhat test",
"test:ethers": "export TESTS_PATH=tests/endpoint && export ETH_LIB=ethers && nyc --reporter=lcov hardhat test",
"test": "yarn test:ethers",
"test:ci:web3": "export TESTS_PATH=tests/e2e && export ETH_LIB=web3 && nyc hardhat test",
"test:ci:ethers": "export TESTS_PATH=tests/e2e && export ETH_LIB=ethers && nyc hardhat test",
"test:ci:ethers": "export TESTS_PATH=tests/e2e && export ETH_LIB=ethers && nyc --reporter=lcov hardhat test",
"test:ci": "yarn test:ci:ethers",
"format:check": "prettier --check \"*/**/*.{js,json,md,ts}\"",
"format": "prettier --write \"*/**/*.{js,json,md,ts}\"",
Expand Down
8 changes: 4 additions & 4 deletions packages/api-kit/tests/e2e/getIncomingTransactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ describe('getIncomingTransactions', () => {
it('should return the list of incoming transactions', async () => {
const safeAddress = '0x9D1E7371852a9baF631Ea115b9815deb97cC3205' // Safe with incoming transactions
const transferListResponse = await safeApiKit.getIncomingTransactions(safeAddress)
chai.expect(transferListResponse.count).to.be.equal(4)
chai.expect(transferListResponse.results.length).to.be.equal(4)
chai.expect(transferListResponse.count).to.be.equal(5)
chai.expect(transferListResponse.results.length).to.be.equal(5)
transferListResponse.results.map((transaction) => {
chai.expect(transaction.to).to.be.equal(safeAddress)
})
Expand All @@ -50,8 +50,8 @@ describe('getIncomingTransactions', () => {
const safeAddress = '0x9D1E7371852a9baF631Ea115b9815deb97cC3205' // Safe with incoming transactions
const eip3770SafeAddress = `${config.EIP_3770_PREFIX}:${safeAddress}`
const transferListResponse = await safeApiKit.getIncomingTransactions(eip3770SafeAddress)
chai.expect(transferListResponse.count).to.be.equal(4)
chai.expect(transferListResponse.results.length).to.be.equal(4)
chai.expect(transferListResponse.count).to.be.equal(5)
chai.expect(transferListResponse.results.length).to.be.equal(5)
transferListResponse.results.map((transaction) => {
chai.expect(transaction.to).to.be.equal(safeAddress)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"test:hardhat:ethers:v1.1.1": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.1.1 && hardhat deploy && nyc hardhat test",
"test:hardhat:ethers:v1.2.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.2.0 && hardhat deploy && nyc hardhat test",
"test:hardhat:ethers:v1.3.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.3.0 && hardhat deploy && nyc hardhat test",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"coverage": "nyc report --reporter=lcov",
"format:check": "prettier --check \"*/**/*.{js,json,md,ts}\"",
"format": "prettier --write \"*/**/*.{js,json,md,ts}\"",
"unbuild": "rimraf dist artifacts deployments cache .nyc_output typechain *.tsbuildinfo",
Expand Down
2 changes: 1 addition & 1 deletion packages/relay-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Relay"
],
"scripts": {
"test": "jest src",
"test": "jest src --coverage",
"format:check": "prettier --check \"*/**/*.{js,json,md,ts}\"",
"format": "prettier --write \"*/**/*.{js,json,md,ts}\"",
"unbuild": "rimraf dist .nyc_output cache",
Expand Down

0 comments on commit bd9eeda

Please sign in to comment.