Skip to content

Commit a447ded

Browse files
committed
Add coverage
1 parent 113a8b2 commit a447ded

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

.github/workflows/checks.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ jobs:
3838
- name: Run tests and generate gas report
3939
run: npm run test
4040

41+
coverage:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
- name: Set up environment
46+
uses: ./.github/actions/setup
47+
- name: Run coverage
48+
run: npm run coverage
49+
4150
tests-foundry:
4251
runs-on: ubuntu-latest
4352
steps:

.solcover.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
skipFiles: ['mocks'],
3+
istanbulReporter: ['html', 'lcov', 'text-summary'],
4+
};

hardhat.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const { argv } = require('yargs/yargs')()
1414
require('@nomicfoundation/hardhat-chai-matchers');
1515
require('@nomicfoundation/hardhat-ethers');
1616
require('hardhat-exposed');
17+
require('solidity-coverage')
1718
require('./hardhat/remappings');
1819

1920
module.exports = {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"compile": "hardhat compile",
1414
"lint": "prettier --log-level warn --ignore-path .gitignore '{contracts,test}/**/*.sol' --check",
1515
"lint:fix": "prettier --log-level warn --ignore-path .gitignore '{contracts,test}/**/*.sol' --write",
16+
"coverage": "hardhat coverage",
1617
"test": "hardhat test"
1718
},
1819
"homepage": "https://openzeppelin.com/contracts/",

test/utils/Masks.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ describe('Masks', function () {
4444
}
4545
});
4646

47+
describe('get', function () {
48+
it('returns group for empty mask', async function () {
49+
expect(await this.mock.$get(ethers.toBeHex(0, 32), 0)).to.be.false;
50+
});
51+
52+
it('returns group for non-empty mask', async function () {
53+
expect(await this.mock.$get(ethers.toBeHex(1, 32), 0)).to.be.true;
54+
});
55+
});
56+
4757
describe('isEmpty', function () {
4858
it('returns true for empty mask', async function () {
4959
expect(await this.mock.$isEmpty(ethers.toBeHex(0, 32))).to.be.true;

0 commit comments

Comments
 (0)