Instrument the code at development build for istanbul (#347)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 10 May 2021 07:18:35 +0000 (09:18 +0200)
committerGitHub <noreply@github.com>
Mon, 10 May 2021 07:18:35 +0000 (09:18 +0200)
README.md
package-lock.json
package.json
rollup.config.mjs

index 7e89e90fe2a76c461262796fc2345a5eec093f76..f2ed11524a5a14ebfeb26e50e6c8672f913dae22 100644 (file)
--- a/README.md
+++ b/README.md
@@ -160,10 +160,12 @@ You can use node versions 12.x, 13.x, 14.x, 16.x
 - `onlineHandler` (optional) - A function that will listen for online event on each worker
 - `exitHandler` (optional) - A function that will listen for exit event on each worker
 - `workerChoiceStrategy` (optional) - The work choice strategy to use in this pool:
+
   - `WorkerChoiceStrategies.ROUND_ROBIN`: Submit tasks to worker in this pool in a round robbin fashion
-  - `WorkerChoiceStrategies.LESS_RECENTLY_USED`: Submit tasks to the less recently used worker in the pool  
-  
+  - `WorkerChoiceStrategies.LESS_RECENTLY_USED`: Submit tasks to the less recently used worker in the pool
+
   Default: `WorkerChoiceStrategies.ROUND_ROBIN`
+
 - `enableEvents` (optional) - Events emission enablement in this pool. Default: true
 
 ### `pool = new DynamicThreadPool/DynamicClusterPool(min, max, filePath, opts)`
index f29e8cfb59d4ee9e2a69fe51dd3838c7a1ef5783..95a6efa627eeee1027a7cbc746bd74c37191fc03 100644 (file)
         "del": "^5.1.0"
       }
     },
+    "rollup-plugin-istanbul": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/rollup-plugin-istanbul/-/rollup-plugin-istanbul-3.0.0.tgz",
+      "integrity": "sha512-z8kD2A57qTcxgqjbJ8cZBBE/IGYk+iJtE42sCaZjrSe/uBEUq5jJYvQwquJ+Acfko1LMYww4EJfeMJmc0GttpQ==",
+      "dev": true,
+      "requires": {
+        "@rollup/pluginutils": "^4.1.0",
+        "istanbul-lib-instrument": "^4.0.3"
+      }
+    },
     "rollup-plugin-terser": {
       "version": "7.0.2",
       "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz",
index affd3c2e739c18539fc369e3157328e571451f3a..9f2606127b1da5e6feefbaa790746bdffba055e0 100644 (file)
@@ -88,6 +88,7 @@
     "rollup-plugin-analyzer": "^4.0.0",
     "rollup-plugin-command": "^1.1.3",
     "rollup-plugin-delete": "^2.0.0",
+    "rollup-plugin-istanbul": "^3.0.0",
     "rollup-plugin-terser": "^7.0.2",
     "rollup-plugin-typescript2": "^0.30.0",
     "sonar-scanner": "^3.1.0",
index 77d516bd6e483da4c5cac72391b3a05cb1bb4087..f301a0871b09c655762b1ceee7495a9fa2af8dc3 100644 (file)
@@ -3,6 +3,7 @@ import analyze from 'rollup-plugin-analyzer'
 import { terser } from 'rollup-plugin-terser'
 import del from 'rollup-plugin-delete'
 import command from 'rollup-plugin-command'
+import istanbul from 'rollup-plugin-istanbul'
 
 const isDevelopmentBuild = process.env.BUILD === 'development'
 const isAnalyze = process.env.ANALYZE
@@ -25,6 +26,7 @@ export default {
         ? 'tsconfig.development.json'
         : 'tsconfig.json'
     }),
+    isDevelopmentBuild && istanbul(),
     del({
       targets: ['lib/*']
     }),