From 41591d35150b9a8d8d28369f0fe74c57708f9ab8 Mon Sep 17 00:00:00 2001 From: Andrew Finlay Date: Mon, 6 Jan 2020 10:33:48 +1100 Subject: [PATCH] feat: Add `cache...` options for instrument command Makes the 'cache' and 'cacheDir' options available for the instrument command --- index.js | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index 288a06f..4fae804 100644 --- a/index.js +++ b/index.js @@ -247,6 +247,21 @@ const report = { } }; +const cache = { + cache: { + description: 'cache instrumentation results for improved performance', + type: 'boolean', + default: true, + nycCommands: nycCommands.instrument, + nycAlias: 'c' + }, + cacheDir: { + description: 'explicitly set location for instrumentation cache', + type: 'string', + nycCommands: nycCommands.instrument + } +}; + const nycMain = { silent: { description: 'don\'t output a report after tests finish running', @@ -268,18 +283,6 @@ const nycMain = { default: false, nycCommands: nycCommands.main }, - cache: { - description: 'cache instrumentation results for improved performance', - type: 'boolean', - default: true, - nycCommands: nycCommands.main, - nycAlias: 'c' - }, - cacheDir: { - description: 'explicitly set location for instrumentation cache', - type: 'string', - nycCommands: nycCommands.main - }, babelCache: { description: 'cache babel transpilation results for improved performance', type: 'boolean', @@ -390,6 +393,9 @@ const nyc = { /* Report options */ ...report, + /* Cache options */ + ...cache, + /* Main command options */ ...nycMain,