diff --git a/c8-ascii-art.txt b/c8-ascii-art.txt new file mode 100644 index 00000000..51ce5f4f --- /dev/null +++ b/c8-ascii-art.txt @@ -0,0 +1,9 @@ +/* ________/\\\\\\\\\_ _____/\\\\\\\\\____ */ +/* _____/\\\////////__ ___/\\\///////\\\__ */ +/* ___/\\\/___________ __\/\\\_____\/\\\__ */ +/* __/\\\_____________ __\///\\\\\\\\\/___ */ +/* _\/\\\_____________ ___/\\\///////\\\__ */ +/* _\//\\\____________ __/\\\______\//\\\_ */ +/* __\///\\\__________ _\//\\\______/\\\__ */ +/* ____\////\\\\\\\\\_ __\///\\\\\\\\\/___ */ +/* _______\/////////__ ____\/////////_____ */ \ No newline at end of file diff --git a/lib/parse-args.js b/lib/parse-args.js index 21a9cd7a..876d9a75 100644 --- a/lib/parse-args.js +++ b/lib/parse-args.js @@ -158,8 +158,17 @@ function buildYargs (withCommands = false) { describe: 'supplying --merge-async will merge all v8 coverage reports asynchronously and incrementally. ' + 'This is to avoid OOM issues with Node.js runtime.' }) + .options('print-config', { + default: false, + type: 'boolean', + describe: 'Print the derived configuration between command line parameters and loaded configuration file' + }) + .options('print-config-format', { + default: 'text', + type: 'string', + describe: 'Format to print the configuration in. Accepted formats are either text or json' + }) .pkgConf('c8') - .demandCommand(1) .check((argv) => { if (!argv.tempDirectory) { argv.tempDirectory = resolve(argv.reportsDir, 'tmp') @@ -181,6 +190,38 @@ function buildYargs (withCommands = false) { // } // }) + const argv = process.argv.slice(2) + const checkArgs = parser(argv) + + let shouldPrint = false + + if (Object.keys(checkArgs).includes('print-config')) { + // checkArgs['print-config'] could contain a boolean or a string + // representing a boolean. + if (typeof checkArgs['print-config'] === 'boolean') { + shouldPrint = checkArgs['print-config'] + } else if (typeof checkArgs['print-config'] === 'string') { + shouldPrint = JSON.parse(checkArgs['print-config']) + } + } + + if (shouldPrint) { + const commandExecutedReference = 'c8 ' + argv.join(' ') + const args = yargs.parse(hideInstrumenteeArgs()) + const cleanArgs = cleanUpArgumentArray(args) + + if (args.printConfigFormat === 'text') { + printConfigText(cleanArgs, commandExecutedReference) + } else if (checkArgs.printConfigFormat === 'json') { + const jsonYargs = JSON.stringify(cleanArgs, 2) + console.log(jsonYargs) + } + + process.exit() + } + + yargs.demandCommand(1) + const checkCoverage = require('./commands/check-coverage') const report = require('./commands/report') if (withCommands) { @@ -217,6 +258,103 @@ function hideInstrumenteeArgs () { return argv } +// Todo: Take a look at Optimizing this function +// exclude certain temporary values and duplicates from printing +// the same variable will be included twice with different keys +// for example args['temp-directory'] && args['tempDirectory'] +// are essentially the same variable +function cleanUpArgumentArray (args) { + const argsToPrint = {} + Object.keys(args).forEach(v => { + if (v && v.length > 1 && v !== '_' && v !== '$0') { + // See if we are dealing with a Camel Case key string + const matches = [...v.matchAll(/([A-Z])/g)] + if (matches.length > 0) { + matches.forEach(m => { + // Derive Kebab Case string from Camel Case Key string + const newKey = m.input.replace(/([A-Z])/g, '-$1').toLowerCase() + // If the Kebab Case key is not assigned a value + if (!args[newKey]) { + // Then assigned it the Camel Case Variable + argsToPrint[newKey] = args[v] + } else if (!args[v]) { + // Other wise assign keep the Kebab Case key value + argsToPrint[newKey] = args[newKey] + } + }) + } else { + // Just keep the value. Either Kebab case or otherwise + argsToPrint[v] = args[v] + } + } + }) + + return argsToPrint +} + +function printConfigText (argsv, commandExecutedReference) { + const banner = readFileSync('./c8-ascii-art.txt', 'utf-8') + console.log('\n\n') + console.log(banner) + console.log('\n\n') + console.log('Command Issued: ' + commandExecutedReference) + console.log('Config File Loaded: ' + argsv.config + '\n\n\n') + console.log('Derived Configuration from CLI options and configuration file') + console.log('------------------------------------------------------------------------------') + + const addSpace = (numOfSpace) => { + let space = '' + for (let i = 0; i < numOfSpace; i++) space += ' ' + const s = space + return s + } + + // Including some formatting variables + // for spacing to make the output more readable + let output = '' + let spaceLength = Object.keys(argsv) + .map(v => String(v).length) + .reduce((p, c) => { + return (p >= c) ? p : c + }) + spaceLength += 10 + + // For each configuration value, print pretty + Object.keys(argsv).forEach(v => { + const fillSpace = addSpace(spaceLength - v.length) + const enumSpace = addSpace(spaceLength) + const value = formatPrintVariable(argsv[v], enumSpace) + output += String(v) + ':' + fillSpace + value + '\n' + }) + console.log(output) +} + +function formatPrintVariable (variable, space) { + let value + + if (Array.isArray(variable) && variable.length > 0) { + value = stringifyObject(variable, space, ']') + } else if (typeof variable === 'object' && Object.keys(variable).length > 0) { + value = stringifyObject(variable, space, '}') + } else if (typeof variable === 'string' && variable) { + value = "'" + variable + "'" + } else if (typeof variable === 'string' && !variable) { + value = "''" + } else { + value = variable + } + + return value +} + +function stringifyObject (variable, space, closingChar) { + const closeReg = new RegExp('\n' + closingChar, 'g') + const out = JSON.stringify(variable, null, '\t\t\t\t ') + .replace(closeReg, '\n' + space + ' ' + closingChar) + + return out +} + module.exports = { buildYargs, hideInstrumenterArgs, diff --git a/package-lock.json b/package-lock.json index 2c60c943..375d7523 100644 --- a/package-lock.json +++ b/package-lock.json @@ -100,6 +100,16 @@ "node": ">=12" } }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@eslint/eslintrc": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", @@ -143,18 +153,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -177,13 +175,12 @@ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, + "version": "0.3.21", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.21.tgz", + "integrity": "sha512-SRfKmRe1KvYnxjEMtxEr+J4HIeMX5YBg/qhRHpxEIGjhX1rshcHlnFUE9K0GazhVKWM7B+nARSkV8LuvJdJ5/g==", "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@tsconfig/node10": { @@ -222,9 +219,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", - "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", + "version": "20.11.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.5.tgz", + "integrity": "sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -258,9 +255,9 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.1.tgz", - "integrity": "sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, "engines": { "node": ">=0.4.0" @@ -292,24 +289,25 @@ } }, "node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true, + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/anymatch": { @@ -533,9 +531,9 @@ } }, "node_modules/chai": { - "version": "4.3.10", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", - "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", @@ -577,6 +575,33 @@ "node": ">=4" } }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/chalk/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, "node_modules/chalk/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -651,19 +676,20 @@ } }, "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dependencies": { - "color-name": "1.1.3" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/concat-map": { "version": "0.0.1", @@ -1198,18 +1224,6 @@ "node": ">=4" } }, - "node_modules/eslint-plugin-import/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/eslint-plugin-import/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -1278,18 +1292,6 @@ "node": ">= 4" } }, - "node_modules/eslint-plugin-node/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/eslint-plugin-node/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -1350,16 +1352,13 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-react/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/eslint-plugin-react/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, "engines": { - "node": "*" + "node": ">=4.0" } }, "node_modules/eslint-plugin-react/node_modules/resolve": { @@ -1392,15 +1391,6 @@ "node": ">=8.0.0" } }, - "node_modules/eslint-scope/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/eslint-utils": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", @@ -1434,21 +1424,6 @@ "node": ">=10" } }, - "node_modules/eslint/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/eslint/node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -1474,24 +1449,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/eslint/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/eslint/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/eslint/node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -1505,18 +1462,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/espree": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", @@ -1565,6 +1510,15 @@ "node": ">=0.10" } }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -1577,7 +1531,7 @@ "node": ">=4.0" } }, - "node_modules/estraverse": { + "node_modules/esrecurse/node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", @@ -1586,6 +1540,15 @@ "node": ">=4.0" } }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -1827,14 +1790,14 @@ } }, "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -1857,17 +1820,6 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/globals": { "version": "12.4.0", "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", @@ -2607,21 +2559,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/log-symbols/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2638,24 +2575,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/log-symbols/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -2709,15 +2628,14 @@ "dev": true }, "node_modules/minimatch": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", - "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", - "dev": true, + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dependencies": { "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=10" + "node": "*" } }, "node_modules/minimist": { @@ -2816,6 +2734,50 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/mocha/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mocha/node_modules/minimatch": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -3383,6 +3345,42 @@ "ansi-styles": "^3.2.0" } }, + "node_modules/pretty-format/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pretty-format/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/pretty-format/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -3612,13 +3610,13 @@ } }, "node_modules/safe-array-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", - "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", + "integrity": "sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.5", + "get-intrinsic": "^1.2.2", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -3650,15 +3648,18 @@ ] }, "node_modules/safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.2.tgz", + "integrity": "sha512-83S9w6eFq12BBIJYvjMux6/dkirb8+4zJRA9cxNBVb7Wq5fJBW+Xze48WqR8pxua7bDuAaaAxtVVd4Idjp1dBQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", + "call-bind": "^1.0.5", + "get-intrinsic": "^1.2.2", "is-regex": "^1.1.4" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3687,15 +3688,16 @@ } }, "node_modules/set-function-length": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", - "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.0.tgz", + "integrity": "sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==", "dev": true, "dependencies": { "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.2", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -3776,39 +3778,6 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", @@ -4001,14 +3970,6 @@ "node": ">=8" } }, - "node_modules/strip-ansi/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -4104,17 +4065,6 @@ "node": ">=8" } }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -4372,15 +4322,6 @@ "node": ">=10.12.0" } }, - "node_modules/v8-to-istanbul/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", - "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -4458,40 +4399,10 @@ "engines": { "node": ">=10" }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -4626,6 +4537,18 @@ "dev": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" + }, + "dependencies": { + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + } } }, "@eslint/eslintrc": { @@ -4664,15 +4587,6 @@ "argparse": "^1.0.7", "esprima": "^4.0.0" } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } } } }, @@ -4692,13 +4606,12 @@ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, + "version": "0.3.21", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.21.tgz", + "integrity": "sha512-SRfKmRe1KvYnxjEMtxEr+J4HIeMX5YBg/qhRHpxEIGjhX1rshcHlnFUE9K0GazhVKWM7B+nARSkV8LuvJdJ5/g==", "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@tsconfig/node10": { @@ -4737,9 +4650,9 @@ "dev": true }, "@types/node": { - "version": "20.10.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", - "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", + "version": "20.11.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.5.tgz", + "integrity": "sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==", "dev": true, "requires": { "undici-types": "~5.26.4" @@ -4765,9 +4678,9 @@ "requires": {} }, "acorn-walk": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.1.tgz", - "integrity": "sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true }, "ajv": { @@ -4789,18 +4702,16 @@ "dev": true }, "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "requires": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" } }, "anymatch": { @@ -4964,9 +4875,9 @@ "dev": true }, "chai": { - "version": "4.3.10", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", - "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", "dev": true, "requires": { "assertion-error": "^1.1.0", @@ -4999,6 +4910,30 @@ "supports-color": "^5.3.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -5052,19 +4987,17 @@ } }, "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "requires": { - "color-name": "1.1.3" + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "concat-map": { "version": "0.0.1", @@ -5334,15 +5267,6 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -5362,21 +5286,6 @@ "supports-color": "^7.1.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -5386,15 +5295,6 @@ "argparse": "^1.0.7", "esprima": "^4.0.0" } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } } } }, @@ -5524,15 +5424,6 @@ "path-exists": "^3.0.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -5585,15 +5476,6 @@ "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", "dev": true }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, "semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -5639,14 +5521,11 @@ "esutils": "^2.0.2" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true }, "resolve": { "version": "2.0.0-next.5", @@ -5669,14 +5548,6 @@ "requires": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" - }, - "dependencies": { - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - } } }, "eslint-utils": { @@ -5734,6 +5605,14 @@ "dev": true, "requires": { "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } } }, "esrecurse": { @@ -5743,12 +5622,20 @@ "dev": true, "requires": { "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } } }, "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, "esutils": { @@ -5925,26 +5812,16 @@ } }, "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" - }, - "dependencies": { - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - } } }, "glob-parent": { @@ -6497,15 +6374,6 @@ "is-unicode-supported": "^0.1.0" }, "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -6515,21 +6383,6 @@ "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true } } }, @@ -6574,10 +6427,9 @@ "dev": true }, "minimatch": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", - "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", - "dev": true, + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "requires": { "brace-expansion": "^1.1.7" } @@ -6652,6 +6504,40 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "minimatch": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -7066,6 +6952,38 @@ "requires": { "ansi-regex": "^3.0.0", "ansi-styles": "^3.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + } } }, "progress": { @@ -7236,13 +7154,13 @@ } }, "safe-array-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", - "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", + "integrity": "sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.5", + "get-intrinsic": "^1.2.2", "has-symbols": "^1.0.3", "isarray": "^2.0.5" } @@ -7254,13 +7172,13 @@ "dev": true }, "safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.2.tgz", + "integrity": "sha512-83S9w6eFq12BBIJYvjMux6/dkirb8+4zJRA9cxNBVb7Wq5fJBW+Xze48WqR8pxua7bDuAaaAxtVVd4Idjp1dBQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", + "call-bind": "^1.0.5", + "get-intrinsic": "^1.2.2", "is-regex": "^1.1.4" } }, @@ -7282,15 +7200,16 @@ } }, "set-function-length": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", - "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.0.tgz", + "integrity": "sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==", "dev": true, "requires": { "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.2", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.1" } }, "set-function-name": { @@ -7342,32 +7261,6 @@ "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } } }, "spdx-correct": { @@ -7502,13 +7395,6 @@ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "requires": { "ansi-regex": "^5.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - } } }, "strip-bom": { @@ -7578,16 +7464,6 @@ "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", "minimatch": "^3.0.4" - }, - "dependencies": { - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - } } }, "text-table": { @@ -7773,17 +7649,6 @@ "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", "convert-source-map": "^2.0.0" - }, - "dependencies": { - "@jridgewell/trace-mapping": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", - "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", - "requires": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - } } }, "validate-npm-package-license": { @@ -7844,29 +7709,6 @@ "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - } } }, "wrappy": { diff --git a/test/help-message-unix.js.snap b/test/help-message-unix.js.snap new file mode 100644 index 00000000..33056bbc --- /dev/null +++ b/test/help-message-unix.js.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`--print-config 1`] = `",/*________/______/____*//*_____/////////_____////////__*//*___//_____________/_____/__*//*__/_______________////___*//*_/________________////////__*//*_//______________/______//_*//*__///___________//______/__*//*____////___////___*//*_______/////////______/////////_____*/CommandIssued:c8--print-configConfigFileLoaded:./.nycrcDerivedConfigurationfromCLIoptionsandconfigurationfile------------------------------------------------------------------------------100:falseprint-config:truereporter:[\\"html\\",\\"text\\"]lines:95branches:82statements:95config:'./.nycrc'reports-dir:'./coverage'report-dir:'./coverage'all:falsesrc:undefinedexclude-node-modules:trueinclude:exclude:[\\"coverage/**\\",\\"packages/*/test{,s}/**\\",\\"**/*.d.ts\\",\\"test{,s}/**\\",\\"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/__tests__/**\\",\\"**/{ava,babel,nyc}.config.{js,cjs,mjs}\\",\\"**/jest.config.{js,cjs,mjs,ts}\\",\\"**/{karma,rollup,webpack}.config.js\\",\\"**/.{eslint,mocha}rc.{js,cjs}\\"]extension:[\\".js\\",\\".cjs\\",\\".mjs\\",\\".ts\\",\\".tsx\\",\\".jsx\\"]exclude-after-remap:falseskip-full:falsecheck-coverage:falsefunctions:0per-file:falsetemp-directory:'./coverage/tmp'clean:trueresolve:''omit-relative:trueallow-external:falsemerge-async:falseprint-config-format:'text',"`; + +exports[`--print-config=false 1`] = `",,c8.js[opts][script][opts]Commands:c8.jscheck-coveragecheckwhethercoverageiswithinthresholdsprovidedc8.jsreportreadV8coveragedatafromtempandoutputreportReportingoptions-r,--reportercoveragereporter(s)touse[default:\\"text\\"]-o,--reports-dir,--report-dirdirectorywherecoveragereportswillbeoutputto[default:\\"./coverage\\"]--allsupplying--allwillcausec8toconsiderallsrcfilesinthecurrentworkingdirectorywhenthedeterminingcoverage.Respectsinclude/exclude.[boolean][default:false]--srcsupplying--srcwilloverridecwdasthedefaultlocationwhere--alllooksforsrcfiles.--srccanbesuppliedmultipletimesandeachdirectorywillbeincluded.Thisallowsforworkspacesspanningmultipleprojects[string]-n,--includealistofspecificfilesthatshouldbecovered(globpatternsaresupported)[default:[]]-x,--excludealistofspecificfilesanddirectoriesthatshouldbeexcludedfromcoverage(globpatternsaresupported)[default:[\\"coverage/**\\",\\"packages/*/test{,s}/**\\",\\"**/*.d.ts\\",\\"test{,s}/**\\",\\"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/__tests__/**\\",\\"**/{ava,babel,nyc}.config.{js,cjs,mjs}\\",\\"**/jest.config.{js,cjs,mjs,ts}\\",\\"**/{karma,rollup,webpack}.config.js\\",\\"**/.{eslint,mocha}rc.{js,cjs}\\"]]-e,--extensionalistofspecificfileextensionsthatshouldbecovered[default:[\\".js\\",\\".cjs\\",\\".mjs\\",\\".ts\\",\\".tsx\\",\\".jsx\\"]]-a,--exclude-after-remapapplyexcludelogictofilesaftertheyareremappedbyasource-map[boolean][default:false]--skip-fulldonotshowfileswith100%statement,branch,andfunctioncoverage[boolean][default:false]Coveragethresholds--check-coveragecheckwhethercoverageiswithinthresholdsprovided[boolean][default:false]--brancheswhat%ofbranchesmustbecovered?[number][default:0]--functionswhat%offunctionsmustbecovered?[number][default:0]--lineswhat%oflinesmustbecovered?[number][default:90]--statementswhat%ofstatementsmustbecovered?[number][default:0]--per-filecheckthresholdsperfile[boolean][default:false]--100shortcutfor--check-coverage--lines100--functions100--branches100--statements100[boolean][default:false]Options:--helpShowhelp[boolean]--versionShowversionnumber[boolean]-c,--configpathtoJSONconfigurationfile[default:(default)]--exclude-node-moduleswhetherornottoexcludeallnode_modulefolders(i.e.**/node_modules/**)bydefault[boolean][default:true]--temp-directorydirectoryV8coveragedataiswrittentoandreadfrom[default:\\"./coverage/tmp\\"]--cleanshouldtempfilesbedeletedbeforescriptexecution[boolean][default:true]--resolveresolvepathstoalternatebasedirectory[default:\\"\\"]--wrapper-lengthhowmanybytesisthewrapperprefixonexecutedJavaScript[number]--omit-relativeomitanypathsthatarenotabsolute,e.g.,internal/net.js[boolean][default:true]--allowExternalsupplying--allowExternalwillcausec8toallowfilesfromoutsideofyourcwd.Thisappliesbothtofilesdiscoveredincoveragetempfilesandalsosrcfilesdiscoveredifusingthe--allflag.[boolean][default:false]--merge-asyncsupplying--merge-asyncwillmergeallv8coveragereportsasynchronouslyandincrementally.ThisistoavoidOOMissueswithNode.jsruntime.[boolean][default:false]--print-configPrintthederivedconfigurationbetweencommandlineparametersandloadedconfigurationfile[boolean][default:false]--print-config-formatFormattoprinttheconfigurationin.Acceptedformatsareeithertextorjson[string][default:\\"text\\"]visithttps://git.io/vHysAforlistofavailablereportersNotenoughnon-optionarguments:got0,needatleast1"`; + +exports[`--print-config=false 2`] = `",zeropositivenegative--------------|---------|----------|---------|---------|-------------------File|%Stmts|%Branch|%Funcs|%Lines|UncoveredLine#s--------------|---------|----------|---------|---------|-------------------Allfiles|64.28|66.66|50|64.28|vanilla|78.26|75|100|78.26|loaded.js|73.68|71.42|100|73.68|4-5,16-18main.js|100|100|100|100|vanilla/dir|0|0|0|0|unloaded.js|0|0|0|0|1-5--------------|---------|----------|---------|---------|-------------------,"`; + +exports[`--print-config=true 1`] = `",/*________/______/____*//*_____/////////_____////////__*//*___//_____________/_____/__*//*__/_______________////___*//*_/________________////////__*//*_//______________/______//_*//*__///___________//______/__*//*____////___////___*//*_______/////////______/////////_____*/CommandIssued:c8--print-config=trueConfigFileLoaded:./.nycrcDerivedConfigurationfromCLIoptionsandconfigurationfile------------------------------------------------------------------------------100:falseprint-config:truereporter:[\\"html\\",\\"text\\"]lines:95branches:82statements:95config:'./.nycrc'reports-dir:'./coverage'report-dir:'./coverage'all:falsesrc:undefinedexclude-node-modules:trueinclude:exclude:[\\"coverage/**\\",\\"packages/*/test{,s}/**\\",\\"**/*.d.ts\\",\\"test{,s}/**\\",\\"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/__tests__/**\\",\\"**/{ava,babel,nyc}.config.{js,cjs,mjs}\\",\\"**/jest.config.{js,cjs,mjs,ts}\\",\\"**/{karma,rollup,webpack}.config.js\\",\\"**/.{eslint,mocha}rc.{js,cjs}\\"]extension:[\\".js\\",\\".cjs\\",\\".mjs\\",\\".ts\\",\\".tsx\\",\\".jsx\\"]exclude-after-remap:falseskip-full:falsecheck-coverage:falsefunctions:0per-file:falsetemp-directory:'./coverage/tmp'clean:trueresolve:''omit-relative:trueallow-external:falsemerge-async:falseprint-config-format:'text',"`; + +exports[`ensure the help message is correct 1`] = `",c8.js[opts][script][opts]Commands:c8.jscheck-coveragecheckwhethercoverageiswithinthresholdsprovidedc8.jsreportreadV8coveragedatafromtempandoutputreportReportingoptions-r,--reportercoveragereporter(s)touse[default:\\"text\\"]-o,--reports-dir,--report-dirdirectorywherecoveragereportswillbeoutputto[default:\\"./coverage\\"]--allsupplying--allwillcausec8toconsiderallsrcfilesinthecurrentworkingdirectorywhenthedeterminingcoverage.Respectsinclude/exclude.[boolean][default:false]--srcsupplying--srcwilloverridecwdasthedefaultlocationwhere--alllooksforsrcfiles.--srccanbesuppliedmultipletimesandeachdirectorywillbeincluded.Thisallowsforworkspacesspanningmultipleprojects[string]-n,--includealistofspecificfilesthatshouldbecovered(globpatternsaresupported)[default:[]]-x,--excludealistofspecificfilesanddirectoriesthatshouldbeexcludedfromcoverage(globpatternsaresupported)[default:[\\"coverage/**\\",\\"packages/*/test{,s}/**\\",\\"**/*.d.ts\\",\\"test{,s}/**\\",\\"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/__tests__/**\\",\\"**/{ava,babel,nyc}.config.{js,cjs,mjs}\\",\\"**/jest.config.{js,cjs,mjs,ts}\\",\\"**/{karma,rollup,webpack}.config.js\\",\\"**/.{eslint,mocha}rc.{js,cjs}\\"]]-e,--extensionalistofspecificfileextensionsthatshouldbecovered[default:[\\".js\\",\\".cjs\\",\\".mjs\\",\\".ts\\",\\".tsx\\",\\".jsx\\"]]-a,--exclude-after-remapapplyexcludelogictofilesaftertheyareremappedbyasource-map[boolean][default:false]--skip-fulldonotshowfileswith100%statement,branch,andfunctioncoverage[boolean][default:false]Coveragethresholds--check-coveragecheckwhethercoverageiswithinthresholdsprovided[boolean][default:false]--brancheswhat%ofbranchesmustbecovered?[number][default:0]--functionswhat%offunctionsmustbecovered?[number][default:0]--lineswhat%oflinesmustbecovered?[number][default:90]--statementswhat%ofstatementsmustbecovered?[number][default:0]--per-filecheckthresholdsperfile[boolean][default:false]--100shortcutfor--check-coverage--lines100--functions100--branches100--statements100[boolean][default:false]Options:--helpShowhelp[boolean]--versionShowversionnumber[boolean]-c,--configpathtoJSONconfigurationfile[default:(default)]--exclude-node-moduleswhetherornottoexcludeallnode_modulefolders(i.e.**/node_modules/**)bydefault[boolean][default:true]--temp-directorydirectoryV8coveragedataiswrittentoandreadfrom[default:\\"./coverage/tmp\\"]--cleanshouldtempfilesbedeletedbeforescriptexecution[boolean][default:true]--resolveresolvepathstoalternatebasedirectory[default:\\"\\"]--wrapper-lengthhowmanybytesisthewrapperprefixonexecutedJavaScript[number]--omit-relativeomitanypathsthatarenotabsolute,e.g.,internal/net.js[boolean][default:true]--allowExternalsupplying--allowExternalwillcausec8toallowfilesfromoutsideofyourcwd.Thisappliesbothtofilesdiscoveredincoveragetempfilesandalsosrcfilesdiscoveredifusingthe--allflag.[boolean][default:false]--merge-asyncsupplying--merge-asyncwillmergeallv8coveragereportsasynchronouslyandincrementally.ThisistoavoidOOMissueswithNode.jsruntime.[boolean][default:false]--print-configPrintthederivedconfigurationbetweencommandlineparametersandloadedconfigurationfile[boolean][default:false]--print-config-formatFormattoprinttheconfigurationin.Acceptedformatsareeithertextorjson[string][default:\\"text\\"]visithttps://git.io/vHysAforlistofavailablereporters,"`; + +exports[`ensure warning message 1`] = `",,c8.js[opts][script][opts]Commands:c8.jscheck-coveragecheckwhethercoverageiswithinthresholdsprovidedc8.jsreportreadV8coveragedatafromtempandoutputreportReportingoptions-r,--reportercoveragereporter(s)touse[default:\\"text\\"]-o,--reports-dir,--report-dirdirectorywherecoveragereportswillbeoutputto[default:\\"./coverage\\"]--allsupplying--allwillcausec8toconsiderallsrcfilesinthecurrentworkingdirectorywhenthedeterminingcoverage.Respectsinclude/exclude.[boolean][default:false]--srcsupplying--srcwilloverridecwdasthedefaultlocationwhere--alllooksforsrcfiles.--srccanbesuppliedmultipletimesandeachdirectorywillbeincluded.Thisallowsforworkspacesspanningmultipleprojects[string]-n,--includealistofspecificfilesthatshouldbecovered(globpatternsaresupported)[default:[]]-x,--excludealistofspecificfilesanddirectoriesthatshouldbeexcludedfromcoverage(globpatternsaresupported)[default:[\\"coverage/**\\",\\"packages/*/test{,s}/**\\",\\"**/*.d.ts\\",\\"test{,s}/**\\",\\"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/__tests__/**\\",\\"**/{ava,babel,nyc}.config.{js,cjs,mjs}\\",\\"**/jest.config.{js,cjs,mjs,ts}\\",\\"**/{karma,rollup,webpack}.config.js\\",\\"**/.{eslint,mocha}rc.{js,cjs}\\"]]-e,--extensionalistofspecificfileextensionsthatshouldbecovered[default:[\\".js\\",\\".cjs\\",\\".mjs\\",\\".ts\\",\\".tsx\\",\\".jsx\\"]]-a,--exclude-after-remapapplyexcludelogictofilesaftertheyareremappedbyasource-map[boolean][default:false]--skip-fulldonotshowfileswith100%statement,branch,andfunctioncoverage[boolean][default:false]Coveragethresholds--check-coveragecheckwhethercoverageiswithinthresholdsprovided[boolean][default:false]--brancheswhat%ofbranchesmustbecovered?[number][default:0]--functionswhat%offunctionsmustbecovered?[number][default:0]--lineswhat%oflinesmustbecovered?[number][default:90]--statementswhat%ofstatementsmustbecovered?[number][default:0]--per-filecheckthresholdsperfile[boolean][default:false]--100shortcutfor--check-coverage--lines100--functions100--branches100--statements100[boolean][default:false]Options:--helpShowhelp[boolean]--versionShowversionnumber[boolean]-c,--configpathtoJSONconfigurationfile[default:(default)]--exclude-node-moduleswhetherornottoexcludeallnode_modulefolders(i.e.**/node_modules/**)bydefault[boolean][default:true]--temp-directorydirectoryV8coveragedataiswrittentoandreadfrom[default:\\"./coverage/tmp\\"]--cleanshouldtempfilesbedeletedbeforescriptexecution[boolean][default:true]--resolveresolvepathstoalternatebasedirectory[default:\\"\\"]--wrapper-lengthhowmanybytesisthewrapperprefixonexecutedJavaScript[number]--omit-relativeomitanypathsthatarenotabsolute,e.g.,internal/net.js[boolean][default:true]--allowExternalsupplying--allowExternalwillcausec8toallowfilesfromoutsideofyourcwd.Thisappliesbothtofilesdiscoveredincoveragetempfilesandalsosrcfilesdiscoveredifusingthe--allflag.[boolean][default:false]--merge-asyncsupplying--merge-asyncwillmergeallv8coveragereportsasynchronouslyandincrementally.ThisistoavoidOOMissueswithNode.jsruntime.[boolean][default:false]--print-configPrintthederivedconfigurationbetweencommandlineparametersandloadedconfigurationfile[boolean][default:false]--print-config-formatFormattoprinttheconfigurationin.Acceptedformatsareeithertextorjson[string][default:\\"text\\"]visithttps://git.io/vHysAforlistofavailablereportersNotenoughnon-optionarguments:got0,needatleast1"`; diff --git a/test/help-message-windows.js.snap b/test/help-message-windows.js.snap new file mode 100644 index 00000000..48a41fc9 --- /dev/null +++ b/test/help-message-windows.js.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`--print-config 1`] = `",/*________/______/____*//*_____/////////_____////////__*//*___//_____________/_____/__*//*__/_______________////___*//*_/________________////////__*//*_//______________/______//_*//*__///___________//______/__*//*____////___////___*//*_______/////////______/////////_____*/CommandIssued:c8--print-configConfigFileLoaded:..nycrcDerivedConfigurationfromCLIoptionsandconfigurationfile------------------------------------------------------------------------------100:falseprint-config:truereporter:[\\"html\\",\\"text\\"]lines:95branches:82statements:95config:'..nycrc'reports-dir:'./coverage'report-dir:'./coverage'all:falsesrc:undefinedexclude-node-modules:trueinclude:exclude:[\\"coverage/**\\",\\"packages/*/test{,s}/**\\",\\"**/*.d.ts\\",\\"test{,s}/**\\",\\"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/__tests__/**\\",\\"**/{ava,babel,nyc}.config.{js,cjs,mjs}\\",\\"**/jest.config.{js,cjs,mjs,ts}\\",\\"**/{karma,rollup,webpack}.config.js\\",\\"**/.{eslint,mocha}rc.{js,cjs}\\"]extension:[\\".js\\",\\".cjs\\",\\".mjs\\",\\".ts\\",\\".tsx\\",\\".jsx\\"]exclude-after-remap:falseskip-full:falsecheck-coverage:falsefunctions:0per-file:falsetemp-directory:'.coveragetmp'clean:trueresolve:''omit-relative:trueallow-external:falsemerge-async:falseprint-config-format:'text',"`; + +exports[`--print-config=false 1`] = `",,c8.js[opts][script][opts]Commands:c8.jscheck-coveragecheckwhethercoverageiswithinthresholdsprovidedc8.jsreportreadV8coveragedatafromtempandoutputreportReportingoptions-r,--reportercoveragereporter(s)touse[default:\\"text\\"]-o,--reports-dir,--report-dirdirectorywherecoveragereportswillbeoutputto[default:\\"./coverage\\"]--allsupplying--allwillcausec8toconsiderallsrcfilesinthecurrentworkingdirectorywhenthedeterminingcoverage.Respectsinclude/exclude.[boolean][default:false]--srcsupplying--srcwilloverridecwdasthedefaultlocationwhere--alllooksforsrcfiles.--srccanbesuppliedmultipletimesandeachdirectorywillbeincluded.Thisallowsforworkspacesspanningmultipleprojects[string]-n,--includealistofspecificfilesthatshouldbecovered(globpatternsaresupported)[default:[]]-x,--excludealistofspecificfilesanddirectoriesthatshouldbeexcludedfromcoverage(globpatternsaresupported)[default:[\\"coverage/**\\",\\"packages/*/test{,s}/**\\",\\"**/*.d.ts\\",\\"test{,s}/**\\",\\"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/__tests__/**\\",\\"**/{ava,babel,nyc}.config.{js,cjs,mjs}\\",\\"**/jest.config.{js,cjs,mjs,ts}\\",\\"**/{karma,rollup,webpack}.config.js\\",\\"**/.{eslint,mocha}rc.{js,cjs}\\"]]-e,--extensionalistofspecificfileextensionsthatshouldbecovered[default:[\\".js\\",\\".cjs\\",\\".mjs\\",\\".ts\\",\\".tsx\\",\\".jsx\\"]]-a,--exclude-after-remapapplyexcludelogictofilesaftertheyareremappedbyasource-map[boolean][default:false]--skip-fulldonotshowfileswith100%statement,branch,andfunctioncoverage[boolean][default:false]Coveragethresholds--check-coveragecheckwhethercoverageiswithinthresholdsprovided[boolean][default:false]--brancheswhat%ofbranchesmustbecovered?[number][default:0]--functionswhat%offunctionsmustbecovered?[number][default:0]--lineswhat%oflinesmustbecovered?[number][default:90]--statementswhat%ofstatementsmustbecovered?[number][default:0]--per-filecheckthresholdsperfile[boolean][default:false]--100shortcutfor--check-coverage--lines100--functions100--branches100--statements100[boolean][default:false]Options:--helpShowhelp[boolean]--versionShowversionnumber[boolean]-c,--configpathtoJSONconfigurationfile[default:(default)]--exclude-node-moduleswhetherornottoexcludeallnode_modulefolders(i.e.**/node_modules/**)bydefault[boolean][default:true]--temp-directorydirectoryV8coveragedataiswrittentoandreadfrom[default:\\".coveragetmp\\"]--cleanshouldtempfilesbedeletedbeforescriptexecution[boolean][default:true]--resolveresolvepathstoalternatebasedirectory[default:\\"\\"]--wrapper-lengthhowmanybytesisthewrapperprefixonexecutedJavaScript[number]--omit-relativeomitanypathsthatarenotabsolute,e.g.,internal/net.js[boolean][default:true]--allowExternalsupplying--allowExternalwillcausec8toallowfilesfromoutsideofyourcwd.Thisappliesbothtofilesdiscoveredincoveragetempfilesandalsosrcfilesdiscoveredifusingthe--allflag.[boolean][default:false]--merge-asyncsupplying--merge-asyncwillmergeallv8coveragereportsasynchronouslyandincrementally.ThisistoavoidOOMissueswithNode.jsruntime.[boolean][default:false]--print-configPrintthederivedconfigurationbetweencommandlineparametersandloadedconfigurationfile[boolean][default:false]--print-config-formatFormattoprinttheconfigurationin.Acceptedformatsareeithertextorjson[string][default:\\"text\\"]visithttps://git.io/vHysAforlistofavailablereportersNotenoughnon-optionarguments:got0,needatleast1"`; + +exports[`--print-config=false 2`] = `",zeropositivenegative--------------|---------|----------|---------|---------|-------------------File|%Stmts|%Branch|%Funcs|%Lines|UncoveredLine#s--------------|---------|----------|---------|---------|-------------------Allfiles|64.28|66.66|50|64.28|vanilla|78.26|75|100|78.26|loaded.js|73.68|71.42|100|73.68|4-5,16-18main.js|100|100|100|100|vanilla/dir|0|0|0|0|unloaded.js|0|0|0|0|1-5--------------|---------|----------|---------|---------|-------------------,"`; + +exports[`--print-config=true 1`] = `",/*________/______/____*//*_____/////////_____////////__*//*___//_____________/_____/__*//*__/_______________////___*//*_/________________////////__*//*_//______________/______//_*//*__///___________//______/__*//*____////___////___*//*_______/////////______/////////_____*/CommandIssued:c8--print-config=trueConfigFileLoaded:..nycrcDerivedConfigurationfromCLIoptionsandconfigurationfile------------------------------------------------------------------------------100:falseprint-config:truereporter:[\\"html\\",\\"text\\"]lines:95branches:82statements:95config:'..nycrc'reports-dir:'./coverage'report-dir:'./coverage'all:falsesrc:undefinedexclude-node-modules:trueinclude:exclude:[\\"coverage/**\\",\\"packages/*/test{,s}/**\\",\\"**/*.d.ts\\",\\"test{,s}/**\\",\\"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/__tests__/**\\",\\"**/{ava,babel,nyc}.config.{js,cjs,mjs}\\",\\"**/jest.config.{js,cjs,mjs,ts}\\",\\"**/{karma,rollup,webpack}.config.js\\",\\"**/.{eslint,mocha}rc.{js,cjs}\\"]extension:[\\".js\\",\\".cjs\\",\\".mjs\\",\\".ts\\",\\".tsx\\",\\".jsx\\"]exclude-after-remap:falseskip-full:falsecheck-coverage:falsefunctions:0per-file:falsetemp-directory:'.coveragetmp'clean:trueresolve:''omit-relative:trueallow-external:falsemerge-async:falseprint-config-format:'text',"`; + +exports[`ensure the help message is correct 1`] = `",c8.js[opts][script][opts]Commands:c8.jscheck-coveragecheckwhethercoverageiswithinthresholdsprovidedc8.jsreportreadV8coveragedatafromtempandoutputreportReportingoptions-r,--reportercoveragereporter(s)touse[default:\\"text\\"]-o,--reports-dir,--report-dirdirectorywherecoveragereportswillbeoutputto[default:\\"./coverage\\"]--allsupplying--allwillcausec8toconsiderallsrcfilesinthecurrentworkingdirectorywhenthedeterminingcoverage.Respectsinclude/exclude.[boolean][default:false]--srcsupplying--srcwilloverridecwdasthedefaultlocationwhere--alllooksforsrcfiles.--srccanbesuppliedmultipletimesandeachdirectorywillbeincluded.Thisallowsforworkspacesspanningmultipleprojects[string]-n,--includealistofspecificfilesthatshouldbecovered(globpatternsaresupported)[default:[]]-x,--excludealistofspecificfilesanddirectoriesthatshouldbeexcludedfromcoverage(globpatternsaresupported)[default:[\\"coverage/**\\",\\"packages/*/test{,s}/**\\",\\"**/*.d.ts\\",\\"test{,s}/**\\",\\"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/__tests__/**\\",\\"**/{ava,babel,nyc}.config.{js,cjs,mjs}\\",\\"**/jest.config.{js,cjs,mjs,ts}\\",\\"**/{karma,rollup,webpack}.config.js\\",\\"**/.{eslint,mocha}rc.{js,cjs}\\"]]-e,--extensionalistofspecificfileextensionsthatshouldbecovered[default:[\\".js\\",\\".cjs\\",\\".mjs\\",\\".ts\\",\\".tsx\\",\\".jsx\\"]]-a,--exclude-after-remapapplyexcludelogictofilesaftertheyareremappedbyasource-map[boolean][default:false]--skip-fulldonotshowfileswith100%statement,branch,andfunctioncoverage[boolean][default:false]Coveragethresholds--check-coveragecheckwhethercoverageiswithinthresholdsprovided[boolean][default:false]--brancheswhat%ofbranchesmustbecovered?[number][default:0]--functionswhat%offunctionsmustbecovered?[number][default:0]--lineswhat%oflinesmustbecovered?[number][default:90]--statementswhat%ofstatementsmustbecovered?[number][default:0]--per-filecheckthresholdsperfile[boolean][default:false]--100shortcutfor--check-coverage--lines100--functions100--branches100--statements100[boolean][default:false]Options:--helpShowhelp[boolean]--versionShowversionnumber[boolean]-c,--configpathtoJSONconfigurationfile[default:(default)]--exclude-node-moduleswhetherornottoexcludeallnode_modulefolders(i.e.**/node_modules/**)bydefault[boolean][default:true]--temp-directorydirectoryV8coveragedataiswrittentoandreadfrom[default:\\".coveragetmp\\"]--cleanshouldtempfilesbedeletedbeforescriptexecution[boolean][default:true]--resolveresolvepathstoalternatebasedirectory[default:\\"\\"]--wrapper-lengthhowmanybytesisthewrapperprefixonexecutedJavaScript[number]--omit-relativeomitanypathsthatarenotabsolute,e.g.,internal/net.js[boolean][default:true]--allowExternalsupplying--allowExternalwillcausec8toallowfilesfromoutsideofyourcwd.Thisappliesbothtofilesdiscoveredincoveragetempfilesandalsosrcfilesdiscoveredifusingthe--allflag.[boolean][default:false]--merge-asyncsupplying--merge-asyncwillmergeallv8coveragereportsasynchronouslyandincrementally.ThisistoavoidOOMissueswithNode.jsruntime.[boolean][default:false]--print-configPrintthederivedconfigurationbetweencommandlineparametersandloadedconfigurationfile[boolean][default:false]--print-config-formatFormattoprinttheconfigurationin.Acceptedformatsareeithertextorjson[string][default:\\"text\\"]visithttps://git.io/vHysAforlistofavailablereporters,"`; + +exports[`ensure warning message 1`] = `",,c8.js[opts][script][opts]Commands:c8.jscheck-coveragecheckwhethercoverageiswithinthresholdsprovidedc8.jsreportreadV8coveragedatafromtempandoutputreportReportingoptions-r,--reportercoveragereporter(s)touse[default:\\"text\\"]-o,--reports-dir,--report-dirdirectorywherecoveragereportswillbeoutputto[default:\\"./coverage\\"]--allsupplying--allwillcausec8toconsiderallsrcfilesinthecurrentworkingdirectorywhenthedeterminingcoverage.Respectsinclude/exclude.[boolean][default:false]--srcsupplying--srcwilloverridecwdasthedefaultlocationwhere--alllooksforsrcfiles.--srccanbesuppliedmultipletimesandeachdirectorywillbeincluded.Thisallowsforworkspacesspanningmultipleprojects[string]-n,--includealistofspecificfilesthatshouldbecovered(globpatternsaresupported)[default:[]]-x,--excludealistofspecificfilesanddirectoriesthatshouldbeexcludedfromcoverage(globpatternsaresupported)[default:[\\"coverage/**\\",\\"packages/*/test{,s}/**\\",\\"**/*.d.ts\\",\\"test{,s}/**\\",\\"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}\\",\\"**/__tests__/**\\",\\"**/{ava,babel,nyc}.config.{js,cjs,mjs}\\",\\"**/jest.config.{js,cjs,mjs,ts}\\",\\"**/{karma,rollup,webpack}.config.js\\",\\"**/.{eslint,mocha}rc.{js,cjs}\\"]]-e,--extensionalistofspecificfileextensionsthatshouldbecovered[default:[\\".js\\",\\".cjs\\",\\".mjs\\",\\".ts\\",\\".tsx\\",\\".jsx\\"]]-a,--exclude-after-remapapplyexcludelogictofilesaftertheyareremappedbyasource-map[boolean][default:false]--skip-fulldonotshowfileswith100%statement,branch,andfunctioncoverage[boolean][default:false]Coveragethresholds--check-coveragecheckwhethercoverageiswithinthresholdsprovided[boolean][default:false]--brancheswhat%ofbranchesmustbecovered?[number][default:0]--functionswhat%offunctionsmustbecovered?[number][default:0]--lineswhat%oflinesmustbecovered?[number][default:90]--statementswhat%ofstatementsmustbecovered?[number][default:0]--per-filecheckthresholdsperfile[boolean][default:false]--100shortcutfor--check-coverage--lines100--functions100--branches100--statements100[boolean][default:false]Options:--helpShowhelp[boolean]--versionShowversionnumber[boolean]-c,--configpathtoJSONconfigurationfile[default:(default)]--exclude-node-moduleswhetherornottoexcludeallnode_modulefolders(i.e.**/node_modules/**)bydefault[boolean][default:true]--temp-directorydirectoryV8coveragedataiswrittentoandreadfrom[default:\\".coveragetmp\\"]--cleanshouldtempfilesbedeletedbeforescriptexecution[boolean][default:true]--resolveresolvepathstoalternatebasedirectory[default:\\"\\"]--wrapper-lengthhowmanybytesisthewrapperprefixonexecutedJavaScript[number]--omit-relativeomitanypathsthatarenotabsolute,e.g.,internal/net.js[boolean][default:true]--allowExternalsupplying--allowExternalwillcausec8toallowfilesfromoutsideofyourcwd.Thisappliesbothtofilesdiscoveredincoveragetempfilesandalsosrcfilesdiscoveredifusingthe--allflag.[boolean][default:false]--merge-asyncsupplying--merge-asyncwillmergeallv8coveragereportsasynchronouslyandincrementally.ThisistoavoidOOMissueswithNode.jsruntime.[boolean][default:false]--print-configPrintthederivedconfigurationbetweencommandlineparametersandloadedconfigurationfile[boolean][default:false]--print-config-formatFormattoprinttheconfigurationin.Acceptedformatsareeithertextorjson[string][default:\\"text\\"]visithttps://git.io/vHysAforlistofavailablereportersNotenoughnon-optionarguments:got0,needatleast1"`; diff --git a/test/help-message.js b/test/help-message.js new file mode 100644 index 00000000..0f162812 --- /dev/null +++ b/test/help-message.js @@ -0,0 +1,128 @@ +/* global describe, before, beforeEach, it */ + +const { runSpawn } = require('./print-config-helpers') +const c8Path = require.resolve('../bin/c8') +const { rm } = require('fs') +const os = require('os') +const isWin = (os.platform() === 'win32') +const OsStr = (isWin) ? 'windows' : 'unix' +const shouldCompressSnapShot = true +const nodePath = process.execPath + +const chaiJestSnapshot = require('chai-jest-snapshot') +require('chai').should() +require('chai') + .use(chaiJestSnapshot) + .should() + +before(cb => rm('tmp', { recursive: true, force: true }, cb)) + +beforeEach(function () { + chaiJestSnapshot.configureUsingMochaContext(this) +}) + +describe(`Help Message - ${OsStr}`, function () { + // Ensure the help message is correct - Snapshot of help message + /** + * Test: Ensure Help Message is Correct + * Command: c8 --help + * + * Runs the hep option and compares to a snapshot + */ + it('ensure the help message is correct', function () { + chaiJestSnapshot.setTestName('ensure the help message is correct') + chaiJestSnapshot.setFilename(`./test/help-message-${OsStr}.js.snap`) + const output = runSpawn([c8Path, '--help'], true, shouldCompressSnapShot) + + output.should.matchSnapshot() + }) + + describe('should demand arguments', function () { + /** + * Test: Ensure 'not enough non-option arguments' warning message + * Command: c8 + * + * Runs c8 with incorrect options to make sure it produces a warning + * + */ + it('ensure warning message', function () { + chaiJestSnapshot.setTestName('ensure warning message') + chaiJestSnapshot.setFilename(`./test/help-message-${OsStr}.js.snap`) + const output = runSpawn([c8Path], true, shouldCompressSnapShot) + + output.should.matchSnapshot() + }) + + /** + * + * Test: should demand arguments: --print-config=false + * Command: c8 --print-config=false + * + */ + it('--print-config=false', function () { + chaiJestSnapshot.setTestName('--print-config=false') + chaiJestSnapshot.setFilename(`./test/help-message-${OsStr}.js.snap`) + const out = runSpawn([c8Path, '--print-config=false'], true, shouldCompressSnapShot) + out.should.matchSnapshot() + }) + }) + + describe('should not demand arguments', function () { + /** + * + * Test: should not demand any arguments: --print-config=true + * Command: c8 --print-config=true + * + * if print-config is true, c8 shouldn't demand any arguments + * + */ + it('--print-config=true', function () { + chaiJestSnapshot.setTestName('--print-config=true') + chaiJestSnapshot.setFilename(`./test/help-message-${OsStr}.js.snap`) + const out = runSpawn([c8Path, '--print-config=true'], true, shouldCompressSnapShot) + out.should.matchSnapshot() + }) + + /** + * + * Test: should not demand any arguments: --print-config + * Command: c8 --print-config + * + * Other variation of if print-config is true, c8 shouldn't + * demand any arguments + * + */ + it('--print-config', function () { + chaiJestSnapshot.setTestName('--print-config') + chaiJestSnapshot.setFilename(`./test/help-message-${OsStr}.js.snap`) + const out = runSpawn([c8Path, '--print-config'], true, shouldCompressSnapShot) + out.should.matchSnapshot() + }) + + /** + * + * Test: should not demand arguments: --print-config=false + * Command: c8 --print-config=false --temp-directory=tmp/vanilla-all \ + * --clean=false --all=true --include=test/fixtures/all/vanilla/**\/*.js + * --exclude=**\/*.ts node ./fixtures/all/vanilla/main + * + */ + it('--print-config=false', function () { + chaiJestSnapshot.setTestName('--print-config=false') + chaiJestSnapshot.setFilename(`./test/help-message-${OsStr}.js.snap`) + const args = [ + c8Path, + '--print-config=false', + '--temp-directory=tmp/vanilla-all', + '--clean=false', + '--all=true', + '--include=test/fixtures/all/vanilla/**/*.js', + '--exclude=**/*.ts', // add an exclude to avoid default excludes of test/** + nodePath, + require.resolve('./fixtures/all/vanilla/main') + ] + const out = runSpawn(args, true, shouldCompressSnapShot) + out.should.matchSnapshot() + }) + }) +}) diff --git a/test/integration.js.snap b/test/integration.js.snap index a9279c7e..9cfdd3c1 100644 --- a/test/integration.js.snap +++ b/test/integration.js.snap @@ -156,7 +156,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.52 | 12.5 | 6.52 | 3.52 | +All files | 3.24 | 12.5 | 6.52 | 3.24 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -166,7 +166,7 @@ All files | 3.52 | 12.5 | 6.52 | 3.52 prettify.js | 0 | 0 | 0 | 0 | 1-2 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | - parse-args.js | 0 | 0 | 0 | 0 | 1-224 + parse-args.js | 0 | 0 | 0 | 0 | 1-362 report.js | 0 | 0 | 0 | 0 | 1-402 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | @@ -521,7 +521,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.52 | 12.5 | 6.52 | 3.52 | +All files | 3.24 | 12.5 | 6.52 | 3.24 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -531,7 +531,7 @@ All files | 3.52 | 12.5 | 6.52 | 3.52 prettify.js | 0 | 0 | 0 | 0 | 1-2 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | - parse-args.js | 0 | 0 | 0 | 0 | 1-224 + parse-args.js | 0 | 0 | 0 | 0 | 1-362 report.js | 0 | 0 | 0 | 0 | 1-402 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | diff --git a/test/print-config-helpers.js b/test/print-config-helpers.js new file mode 100644 index 00000000..3fe6de5c --- /dev/null +++ b/test/print-config-helpers.js @@ -0,0 +1,75 @@ +const { spawnSync } = require('child_process') +const os = require('os') + +const nodePath = process.execPath +const isWin = (os.platform() === 'win32') +const pwd = process.cwd() +const whiteSpaceReg = /[\\\s]/g +const pwdReg = new RegExp(pwd, 'g') + +const runSpawn = (args, text = false, stripWhiteSpace = false) => { + const doubleQuoteReg = /"/g + const slashReg = /\\/g + + const { output } = spawnSync(nodePath, args) + + let out = output.toString('utf8') + + if (isWin && text) { + const jsonEncodedPwd = JSON.stringify(pwd) + .replace(doubleQuoteReg, '') + const encodedPwdRegEx = new RegExp(jsonEncodedPwd, 'g') + out = out.replace(encodedPwdRegEx, '.') + } else if (isWin && !text) { + const jsonEncodedPwd = JSON.stringify(pwd) + .replace(doubleQuoteReg, '') + .replace(slashReg, '\\\\') + const encodedPwdRegEx = new RegExp(jsonEncodedPwd, 'g') + out = out.replace(encodedPwdRegEx, '.') + } else if (!isWin) { + out = out.replace(pwdReg, '.') + } + + // For certain cases we need to strip out all whitespace in + // snapshots. It's not ideal and it makes it hard to read + // but I am concern about this issue in the chai-snapshot + // package + // + // https://github.com/jestjs/jest/pull/9203 + + if (text && stripWhiteSpace) { out = out.replace(whiteSpaceReg, '') } + + if (!text) { out = cleanJson(out) } + + return out +} + +// JSON needs to get scrubbed from additional characters +// when being read from SpawnSync +const cleanJson = (out) => { + const o = out.substring(1) + .substring(0, out.length - 2) + .replace(pwdReg, '.') + + return JSON.parse(o) +} + +const textGetConfigKey = (out, key) => { + const newLineReturn = (isWin) ? '\r\n' : '\n' + const newLineRegEx = new RegExp(newLineReturn, 'g') + + let value = null + const keyReg = new RegExp(key + ':.+', 'g') + const matches = [...out.matchAll(keyReg)] + if (matches.length > 0 && typeof matches[0][0] === 'string') { + const fileName = matches[0][0].replace(newLineRegEx, '') + .replace(key + ':', '') + .replace(whiteSpaceReg, '') + .replace(/'/g, '') + value = fileName + } + + return value +} + +module.exports = { runSpawn, cleanJson, textGetConfigKey } diff --git a/test/print-config-unix.js.snap b/test/print-config-unix.js.snap new file mode 100644 index 00000000..2e303e9f --- /dev/null +++ b/test/print-config-unix.js.snap @@ -0,0 +1,54 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ensure valid json 1`] = ` +Object { + "100": false, + "all": false, + "allow-external": false, + "branches": 82, + "check-coverage": false, + "clean": true, + "config": "./.nycrc", + "exclude": Array [ + "coverage/**", + "packages/*/test{,s}/**", + "**/*.d.ts", + "test{,s}/**", + "test{,-*}.{js,cjs,mjs,ts,tsx,jsx}", + "**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}", + "**/__tests__/**", + "**/{ava,babel,nyc}.config.{js,cjs,mjs}", + "**/jest.config.{js,cjs,mjs,ts}", + "**/{karma,rollup,webpack}.config.js", + "**/.{eslint,mocha}rc.{js,cjs}", + ], + "exclude-after-remap": false, + "exclude-node-modules": true, + "extension": Array [ + ".js", + ".cjs", + ".mjs", + ".ts", + ".tsx", + ".jsx", + ], + "functions": 0, + "include": Array [], + "lines": 95, + "merge-async": false, + "omit-relative": true, + "per-file": false, + "print-config": true, + "print-config-format": "json", + "report-dir": "./coverage", + "reporter": Array [ + "html", + "text", + ], + "reports-dir": "./coverage", + "resolve": "", + "skip-full": false, + "statements": 95, + "temp-directory": "./coverage/tmp", +} +`; diff --git a/test/print-config-windows.js.snap b/test/print-config-windows.js.snap new file mode 100644 index 00000000..57d21080 --- /dev/null +++ b/test/print-config-windows.js.snap @@ -0,0 +1,54 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ensure valid json 1`] = ` +Object { + "100": false, + "all": false, + "allow-external": false, + "branches": 82, + "check-coverage": false, + "clean": true, + "config": ".\\\\.nycrc", + "exclude": Array [ + "coverage/**", + "packages/*/test{,s}/**", + "**/*.d.ts", + "test{,s}/**", + "test{,-*}.{js,cjs,mjs,ts,tsx,jsx}", + "**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}", + "**/__tests__/**", + "**/{ava,babel,nyc}.config.{js,cjs,mjs}", + "**/jest.config.{js,cjs,mjs,ts}", + "**/{karma,rollup,webpack}.config.js", + "**/.{eslint,mocha}rc.{js,cjs}", + ], + "exclude-after-remap": false, + "exclude-node-modules": true, + "extension": Array [ + ".js", + ".cjs", + ".mjs", + ".ts", + ".tsx", + ".jsx", + ], + "functions": 0, + "include": Array [], + "lines": 95, + "merge-async": false, + "omit-relative": true, + "per-file": false, + "print-config": true, + "print-config-format": "json", + "report-dir": "./coverage", + "reporter": Array [ + "html", + "text", + ], + "reports-dir": "./coverage", + "resolve": "", + "skip-full": false, + "statements": 95, + "temp-directory": ".\\\\coverage\\\\tmp", +} +`; diff --git a/test/print-config.js b/test/print-config.js new file mode 100644 index 00000000..3711a116 --- /dev/null +++ b/test/print-config.js @@ -0,0 +1,144 @@ +/* global describe, before, beforeEach, it */ + +const { rm } = require('fs') +const { runSpawn, textGetConfigKey } = require('./print-config-helpers') +const c8Path = require.resolve('../bin/c8') +const os = require('os') +const isWin = (os.platform() === 'win32') +const OsStr = (isWin) ? 'windows' : 'unix' +const chaiJestSnapshot = require('chai-jest-snapshot') +const { assert } = require('chai') + +require('chai').should() +require('chai') + .use(chaiJestSnapshot) + .should() + +before(cb => rm('tmp', { recursive: true, force: true }, cb)) + +beforeEach(function () { + chaiJestSnapshot.configureUsingMochaContext(this) +}) + +describe(`print derived configuration CLI option - ${OsStr}`, function () { + /** + * + * Test: Ensure Valid JSON + * Command: c8 --print-config --print-config-format=json + * + * ensure --print-config-format=json prints valid json document + */ + it('ensure valid json', function () { + chaiJestSnapshot.setTestName('ensure valid json') + chaiJestSnapshot.setFilename(`./test/print-config-${OsStr}.js.snap`) + + try { + const out = runSpawn([c8Path, '--print-config', '--print-config-format=json']) + out.should.matchSnapshot() + } catch (e) { + assert.fail('invalid json document produced from --print-config option') + } + }) + + /** + * + * Test: Ensure comma delimited values transform into an array + * Command: C8 --reporter=lcov,text --print-config --print-config-format=json + * + * Todo: There is a bug in yargs where this is not transformedd into an array + * Skipping test for now + */ + it('ensure comma delimited values transform into an array', function () { + this.skip() + const out = runSpawn([ + c8Path, + '--reporter=lcov,text', + '--print-config', + '--print-config-format=json' + ]) + + const includesKey = Object.keys(out).includes('reporter') + const checkFor = ['lcov', 'text'] + includesKey.should.eql(true) + out.reporter.should.eql(checkFor) + }) + + /** + * + * Test: Ensure default project configuration file is loaded + * Command: c8 --print-config + * + */ + it('ensure default project configuration file is loaded', function () { + const out = runSpawn([c8Path, '--print-config', '--print-config-format=json']) + + const includesKey = Object.keys(out).includes('config') + includesKey.should.eql(true) + out.config.endsWith('.nycrc') + }) + + ;['text', 'json'].forEach((format) => { + describe(`${format} format option`, function () { + // Can I shorten this line? + const textParam = (format === 'text') + + /** + * + * Test: ensure loads config file from cli + * Command: c8 -c ./test/fixtures/config/.c8rc.json --print-config --print-config-format=json|text + * + */ + it('ensure loads config file from cli', function () { + // Can I shorten this line? + const out = runSpawn([ + c8Path, + '--config=./test/fixtures/config/.c8rc.json', + '--print-config', + `--print-config-format=${format}` + ], textParam) + + if (format === 'json') { + const includesKey = Object.keys(out).includes('config') + includesKey.should.eql(true) + out.config.should.eql('./test/fixtures/config/.c8rc.json') + } else if (format === 'text') { + const value = textGetConfigKey(out, 'config') + if (value) { + value.should.eql('./test/fixtures/config/.c8rc.json') + } else { + assert.fail('couldn\'t find configuration value for option --config') + } + } + }) + + /** + * + * Test: Ensure loads reporter option from cli + * Command: c8 --reporter=lcov --print-config + * + */ + it('ensure loads reporter option from cli', function () { + const out = runSpawn([ + c8Path, + '--reporter=lcov', + '--print-config', + `--print-config-format=${format}` + ], textParam) + + if (format === 'json') { + const includesKey = Object.keys(out).includes('reporter') + includesKey.should.eql(true) + out.reporter.should.eql('lcov') + } else if (format === 'text') { + const value = textGetConfigKey(out, 'reporter') + if (value) { + // Todo: when the load comma delimited text array bug is fixed, need to adjust this line + value.should.eql('lcov') + } else { + assert.fail('couldn\'t find configuration value for option --reporter') + } + } + }) + }) + }) +})