From cc29785cf1ba9b3a7a64fc7094480201ac35b584 Mon Sep 17 00:00:00 2001 From: nmauersberg Date: Wed, 17 Nov 2021 15:37:23 +0100 Subject: [PATCH] Add scripts to collect ts test coverage --- .gitignore | 1 + Makefile | 6 ++++++ packages/components/package.json | 3 ++- packages/playground/package.json | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c2560c19e..85086780e 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ packages/_generated/src !.yarn/releases !.yarn/sdks !.yarn/versions +coverage diff --git a/Makefile b/Makefile index d1e57ed22..caf79aa40 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,9 @@ playground-test: playground-test-watch: yarn workspace playground run test:watch +playground-test-coverage: + yarn workspace playground run test:coverage + playground-bundlesize: yarn workspace playground run bundlesize @@ -69,6 +72,9 @@ components-test: components-test-watch: yarn workspace @paritytech/components run test:watch +components-test-coverage: + yarn workspace @paritytech/components run test:coverage + ################################################################################ # ENTRYPOINT: crate-extractor ################################################################################ diff --git a/packages/components/package.json b/packages/components/package.json index 8a6403cbd..aa7f428be 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -7,7 +7,8 @@ "clean": "rimraf dist pkg node_modules", "test": "jest --update-snapshot", "test:watch": "jest --update-snapshot --watch", - "test:clear": "jest --clearCache" + "test:clear": "jest --clearCache", + "test:coverage": "jest --update-snapshot --collectCoverage" }, "author": "", "license": "ISC", diff --git a/packages/playground/package.json b/packages/playground/package.json index 7a1a1bd2c..f5507669d 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -16,6 +16,7 @@ "test": "jest --update-snapshot", "test:watch": "jest --update-snapshot --watch", "test:clear": "jest --clearCache", + "test:coverage": "jest --update-snapshot --collectCoverage", "bundlesize": "yarn bundlesize:generate && webpack-bundle-analyzer --port 8081 bundle-size-stats.json dist", "bundlesize:generate": "yarn build && yarn webpack --stats --json=bundle-size-stats.json" },