Skip to content

Commit 894e90c

Browse files
authored
Fix coverage with new vitest setup (#377)
1 parent e2e12ba commit 894e90c

6 files changed

Lines changed: 20 additions & 15 deletions

File tree

.codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ coverage:
66
status:
77
project:
88
default:
9-
target: 95%
9+
target: 85%
1010
patch:
1111
default:
12-
target: 95%
12+
target: 90%

DEVELOPMENT.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,7 @@ To run specific tests, you can use the `-t` flag to match the name mentioned in
7373
# Run all tests in the 'Transaction Builder' describe block (test/e2e/transaction-builder/TransactionBuilder.test.ts)
7474
yarn test -t 'Transaction Builder'
7575
```
76+
77+
## Code Coverage
78+
79+
New contributions have a code coverage target of 90%+. You can run `yarn test --coverage` to see the coverage report before submitting a PR.

packages/cashc/vitest.config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { defineConfig } from 'vitest/config';
22

33
export default defineConfig({
4-
root: './test',
54
test: {
65
environment: 'node',
6+
include: ['test/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
7+
exclude: ['**/types/**'],
78
globals: true,
89
silent: 'passed-only',
9-
include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)'],
10-
setupFiles: ['./vitest.setup.ts'],
11-
exclude: ['**/types/**'],
1210
coverage: {
1311
provider: 'v8',
14-
reporter: ['json-summary'],
12+
include: ['src/**/*.ts'],
13+
exclude: ['src/grammar/**/*.ts'],
1514
},
15+
setupFiles: ['./vitest.setup.ts'],
1616
},
1717
});
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { defineConfig } from 'vitest/config';
22

33
export default defineConfig({
4-
root: './test',
54
test: {
65
environment: 'node',
7-
include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)'],
8-
setupFiles: ['./vitest.setup.ts'],
6+
include: ['test/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
97
exclude: ['**/types/**'],
10-
testTimeout: 50000,
118
globals: true,
129
silent: 'passed-only',
1310
coverage: {
1411
provider: 'v8',
12+
include: ['src/**/*.ts'],
1513
},
14+
setupFiles: ['./vitest.setup.ts'],
15+
testTimeout: 50000,
1616
},
1717
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { inspect } from 'util';
2-
import '../src/test/TestExtensions.js';
2+
import './src/test/TestExtensions.js';
33

44
inspect.defaultOptions.depth = 10;

packages/utils/vitest.config.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { defineConfig } from 'vitest/config';
22

33
export default defineConfig({
4-
root: './test',
54
test: {
65
environment: 'node',
7-
silent: 'passed-only',
6+
include: ['test/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
7+
exclude: ['**/types/**'],
88
globals: true,
9+
silent: 'passed-only',
910
coverage: {
1011
provider: 'v8',
11-
reporter: ['json-summary'],
12+
include: ['src/**/*.ts'],
1213
},
1314
},
1415
});

0 commit comments

Comments
 (0)