Skip to content

Commit

Permalink
Merge pull request #158 from BlockchainAsset/156-test-update
Browse files Browse the repository at this point in the history
- Update Test
- Added path to lcov
- Locked Yarn package
- Updated few packages and added husky
- Updated Node Version to 20
  • Loading branch information
remedcu authored Feb 10, 2024
2 parents 68d54d8 + 7386133 commit dda7fa9
Show file tree
Hide file tree
Showing 8 changed files with 3,278 additions and 15 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16, 18]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: 20.x
- name: Installing Packages
run: yarn install --frozen-lockfile
- name: Checking Formatting
Expand All @@ -30,6 +25,7 @@ jobs:
- name: Code Coverage
run: yarn coverage
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ cache
script
out
.vscode
yarn.lock
lcov.info
4 changes: 4 additions & 0 deletions .husky/_/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh

yarn prettier
yarn lint
4 changes: 4 additions & 0 deletions .husky/_/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh

yarn prettier-check
yarn test
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
}
},
"dependencies": {
"yarn": "^1.22.10"
"yarn": "1.22.21"
},
"devDependencies": {
"coveralls": "3.1.1",
"husky": "9.0.10",
"prettier": "3.2.5",
"prettier-plugin-solidity": "1.3.1",
"sol2uml": "2.5.20",
Expand Down
4 changes: 2 additions & 2 deletions test/split.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
pragma solidity 0.8.23;

import "forge-std/Test.sol";
import "../src/Splitter.sol";
Expand Down Expand Up @@ -60,7 +60,7 @@ contract SplitterTest is Test {
}

function testSplitZeroAddress() public {
vm.expectRevert();
vm.expectRevert(bytes4(keccak256("ZeroAddressNotAllowed()")));
vm.prank(alice);
splitter.split{ value: amount }(address(0), address(0));
}
Expand Down
4 changes: 2 additions & 2 deletions test/withdraw.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
pragma solidity 0.8.23;

import "forge-std/Test.sol";
import "../src/Splitter.sol";
Expand Down Expand Up @@ -81,7 +81,7 @@ contract SplitterTest is Test {
}

function testWithdrawZero() public {
vm.expectRevert();
vm.expectRevert(bytes4(keccak256("ZeroAmountNotAllowed()")));
vm.prank(bob);
splitter.withdraw(0);
}
Expand Down
Loading

0 comments on commit dda7fa9

Please sign in to comment.