Skip to content

Commit 18d8a24

Browse files
authored
Merge pull request #2 from smartcontractkit/chore/setup-coverage-threshold
Chore/setup coverage threshold
2 parents 48cff0c + 560fdf2 commit 18d8a24

File tree

8 files changed

+77
-43
lines changed

8 files changed

+77
-43
lines changed

.github/workflows/lint.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/prettier.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Prettier Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
prettier:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: 18
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run Prettier check
25+
run: npx prettier --check .

.github/workflows/test-converage.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test Coverage
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
coverage:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: 18
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run tests with coverage
25+
run: npm test -- --coverage

.github/workflows/test.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v2
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
1515

16-
- name: Set up Node.js
17-
uses: actions/setup-node@v2
18-
with:
19-
node-version: 18
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: 18
2020

21-
- name: Install dependencies
22-
run: npm ci
21+
- name: Install dependencies
22+
run: npm ci
2323

24-
- name: Run Jest tests
25-
run: npm test
24+
- name: Run Jest tests
25+
run: npm test

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# functions-toolkit
2+
23
An NPM package with collection of functions that can be used for working with Chainlink Functions.

jest.config.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,13 @@ module.exports = {
33
testEnvironment: 'node',
44
testMatch: ['**/test/**/*.test.ts'],
55
coverageReporters: ['html'],
6-
collectCoverageFrom: ['src/**/*.ts','!src/test/*.ts']
7-
};
6+
collectCoverageFrom: ['src/**/*.ts', '!src/test/*.ts'],
7+
coverageThreshold: {
8+
global: {
9+
branches: 95,
10+
functions: 95,
11+
lines: 95,
12+
statements: 95,
13+
},
14+
},
15+
}

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "An NPM package with collection of functions that can be used for working with Chainlink Functions.",
55
"main": "index.js",
66
"scripts": {
7-
"test": "jest"
7+
"test": "jest",
8+
"lint:fix": "npx prettier -w ."
89
},
910
"repository": {
1011
"type": "git",
@@ -31,9 +32,6 @@
3132
"ts-jest": "^29.1.0",
3233
"typescript": "^5.0.4"
3334
},
34-
"dependencies": {
35-
"ethers": "^6.3.0"
36-
},
3735
"prettier": {
3836
"printWidth": 120,
3937
"tabWidth": 2,
@@ -44,5 +42,8 @@
4442
"bracketSpacing": true,
4543
"arrowParens": "avoid",
4644
"proseWrap": "preserve"
45+
},
46+
"dependencies": {
47+
"ethers": "^6.3.0"
4748
}
4849
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
21
describe('Subscription management', () => {
32
it('works', () => {
43
expect(true).toBe(true)
54
})
6-
})
5+
})

0 commit comments

Comments
 (0)