diff --git a/.circleci/config.yml b/.circleci/config.yml index 071b82f87..8f787a3d9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,6 +24,9 @@ jobs: - run: name: Run tests command: npm run test:ci + - run: + name: Upload coverage + command: npm run coverage:upload - store_test_results: path: junit.xml diff --git a/.cspell/cspell-dict.txt b/.cspell/cspell-dict.txt index fe37da297..396cfd18d 100644 --- a/.cspell/cspell-dict.txt +++ b/.cspell/cspell-dict.txt @@ -35,6 +35,7 @@ caes cand Childs childs +codecov compabitle compatbility Compatiblity diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..fa6fee59b --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + project: + default: + threshold: 1% + patch: + default: + target: 0% \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d8d08562e..76f6923ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,6 +41,7 @@ "@types/uuid": "9.0.3", "@typescript-eslint/eslint-plugin": "5.62.0", "bunyan": "1.8.15", + "codecov": "3.8.3", "cspell": "6.31.3", "graphql": "16.8.0", "graphql-http": "1.22.0", @@ -4740,6 +4741,16 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/argv": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz", + "integrity": "sha512-dEamhpPEwRUBpLNHeuCm/v+g0anFByHahxodVO/BbAarHVBBg2MccCwf9K+o1Pof+2btdnkJelYVUWjW/VrATw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "engines": { + "node": ">=0.6.10" + } + }, "node_modules/arr-diff": { "version": "4.0.0", "dev": true, @@ -5807,6 +5818,26 @@ "node": ">= 0.12.0" } }, + "node_modules/codecov": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.8.3.tgz", + "integrity": "sha512-Y8Hw+V3HgR7V71xWH2vQ9lyS358CbGCldWlJFR0JirqoGtOoas3R3/OclRTvgUYFK29mmJICDPauVKmpqbwhOA==", + "deprecated": "https://about.codecov.io/blog/codecov-uploader-deprecation-plan/", + "dev": true, + "dependencies": { + "argv": "0.0.2", + "ignore-walk": "3.0.4", + "js-yaml": "3.14.1", + "teeny-request": "7.1.1", + "urlgrey": "1.0.0" + }, + "bin": { + "codecov": "bin/codecov" + }, + "engines": { + "node": ">=4.0" + } + }, "node_modules/collect-v8-coverage": { "version": "1.0.1", "dev": true, @@ -8804,6 +8835,15 @@ "node": ">= 4" } }, + "node_modules/ignore-walk": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz", + "integrity": "sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==", + "dev": true, + "dependencies": { + "minimatch": "^3.0.4" + } + }, "node_modules/immutable": { "version": "3.7.6", "dev": true, @@ -16126,6 +16166,15 @@ "node": ">= 0.4" } }, + "node_modules/stream-events": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", + "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", + "dev": true, + "dependencies": { + "stubs": "^3.0.0" + } + }, "node_modules/stream-transform": { "version": "2.1.3", "dev": true, @@ -16304,6 +16353,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/stubs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", + "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", + "dev": true + }, "node_modules/supports-color": { "version": "7.2.0", "license": "MIT", @@ -16397,6 +16452,54 @@ "version": "4.0.0", "license": "ISC" }, + "node_modules/teeny-request": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-7.1.1.tgz", + "integrity": "sha512-iwY6rkW5DDGq8hE2YgNQlKbptYpY5Nn2xecjQiNjOXWbKzPGUfmeUBCSQbbr306d7Z7U2N0TPl+/SwYRfua1Dg==", + "dev": true, + "dependencies": { + "http-proxy-agent": "^4.0.0", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.1", + "stream-events": "^1.0.5", + "uuid": "^8.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/teeny-request/node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/teeny-request/node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/teeny-request/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/term-size": { "version": "2.2.1", "dev": true, @@ -17093,6 +17196,15 @@ "requires-port": "^1.0.0" } }, + "node_modules/urlgrey": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-1.0.0.tgz", + "integrity": "sha512-hJfIzMPJmI9IlLkby8QrsCykQ+SXDeO2W5Q9QTW3QpqZVTx4a/K7p8/5q+/isD8vsbVaFgql/gvAoQCRQ2Cb5w==", + "dev": true, + "dependencies": { + "fast-url-parser": "^1.1.3" + } + }, "node_modules/urlpattern-polyfill": { "version": "6.0.2", "dev": true, diff --git a/package.json b/package.json index e1c6d0c68..ab7fcf82e 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,9 @@ "test:clean": "jest --clearCache", "test:watch": "jest --verbose --watchAll", "testonly": "npm test", - "test:ci": "npm test -- --ci --maxWorkers=2 --reporters=default --reporters=jest-junit", + "test:ci": "npm run coverage -- --ci --maxWorkers=2 --reporters=default --reporters=jest-junit", + "coverage": "npm test -- --coverage", + "coverage:upload": "codecov", "codegen": "graphql-codegen --config codegen.yml", "codegen:check": "npm run codegen && git diff --exit-code", "lint": "eslint . --ext .ts", @@ -67,6 +69,7 @@ "@types/uuid": "9.0.3", "@typescript-eslint/eslint-plugin": "5.62.0", "bunyan": "1.8.15", + "codecov": "3.8.3", "cspell": "6.31.3", "graphql": "16.8.0", "graphql-http": "1.22.0",