Skip to content

Commit 540de87

Browse files
committed
ci: fail CI if coverage is not 100% but still upload to codecov
1 parent 20a8f55 commit 540de87

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
run: npm run testonly:cover
9898

9999
- name: Upload coverage to Codecov
100+
if: ${{ always() }}
100101
uses: codecov/codecov-action@v1
101102
with:
102103
file: ./coverage/tests/coverage-final.json

.nycrc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@ temp-directory: 'coverage/tests'
1919
report-dir: 'coverage/tests'
2020
skip-full: true
2121
reporter: [json, html, text]
22+
check-coverage: true
23+
branches: 100
24+
lines: 100
25+
functions: 100
26+
statements: 100

src/utilities/__tests__/buildASTSchema-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function cycleSDL(sdl, options) {
5555
}
5656

5757
function printASTNode(obj) {
58-
invariant(obj?.astNode != null);
58+
invariant(obj != null && obj.astNode != null);
5959
return print(obj.astNode);
6060
}
6161

src/utilities/__tests__/extendSchema-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { extendSchema } from '../extendSchema';
3838
import { buildSchema } from '../buildASTSchema';
3939

4040
function printExtensionNodes(obj) {
41-
invariant(obj?.extensionASTNodes != null);
41+
invariant(obj != null && obj.extensionASTNodes != null);
4242
return print({
4343
kind: Kind.DOCUMENT,
4444
definitions: obj.extensionASTNodes,
@@ -57,7 +57,7 @@ function printSchemaChanges(schema, extendedSchema) {
5757
}
5858

5959
function printASTNode(obj) {
60-
invariant(obj?.astNode != null);
60+
invariant(obj != null && obj.astNode != null);
6161
return print(obj.astNode);
6262
}
6363

0 commit comments

Comments
 (0)