From 5519f8f39ad88a04da95fb6225e61dbdfbab002f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 10 May 2021 09:18:35 +0200 Subject: [PATCH] Instrument the code at development build for istanbul (#347) --- README.md | 6 ++++-- package-lock.json | 10 ++++++++++ package.json | 1 + rollup.config.mjs | 2 ++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7e89e90f..f2ed1152 100644 --- 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)` diff --git a/package-lock.json b/package-lock.json index f29e8cfb..95a6efa6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4479,6 +4479,16 @@ "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", diff --git a/package.json b/package.json index affd3c2e..9f260612 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/rollup.config.mjs b/rollup.config.mjs index 77d516bd..f301a087 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -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/*'] }), -- 2.34.1