node tests: Clean up nyc arguments.

nyc was added in 29f04511c0

All the stuff after "&&" was actually passed to
node, because we didn't use shell=True, so the
"nyc report" command didn't run, and the ugly
finder.js code just skipped over all the final tokens.
This commit is contained in:
Steve Howell 2020-09-02 20:45:59 +00:00 committed by Steve Howell
parent b84260014a
commit e9bbfbc624
1 changed files with 5 additions and 7 deletions

View File

@ -223,15 +223,13 @@ def run_tests_via_node_js() -> int:
node_tests_cmd += individual_files
if options.coverage:
coverage_dir = os.path.join(ROOT_DIR, 'var/node-coverage')
coverage_lcov_file = os.path.join(coverage_dir, 'lcov.info')
nyc = os.path.join(ROOT_DIR, 'node_modules/.bin/nyc')
command = [nyc, '--extension', '.hbs', '--extension', '.ts']
command += ['--report-dir', coverage_dir]
command += ['--temp-directory', coverage_dir, '-r=text-summary']
nyc = os.path.join(ROOT_DIR, "node_modules/.bin/nyc")
command = [nyc, "--extension", ".hbs", "--extension", ".ts"]
command += ["--report-dir", coverage_dir]
command += ["--temp-directory", coverage_dir]
command += ["-r=lcov", "-r=json", "-r=text-summary"]
command += node_tests_cmd
command += ['&&', 'nyc', 'report', '-r=lcov', '-r=json']
command += ['>', coverage_lcov_file]
else:
# Normal testing, no coverage analysis.
# Run the index.js test runner, which runs all the other tests.