사용 istanbul report html
을 할 수있는 편리한 방법이 있는지 생각 "coverage"로 시작하고 ".json"으로 끝나는 모든 파일에 대한 디렉토리 (및 하위 디렉토리)를 지정하고 HTML 보고서를 ./coverage/
디렉토리로 출력합니다.
특정 디렉토리에 특정 파일을 변환하려면 다음과
--root
옵션을 사용하여 다음과 같이
istanbul report --include path/to/my-coverage-file.json --dir my-coverage-dir html
만 특정 디렉토리에서 커버리지 리포트를 읽을 수있는 또 다른 방법 (예를 들어 path/to
의 모든 JSON 파일)입니다 : 더 많은 옵션을 볼 수
istanbul report --root path/to --include=*.json --dir my-coverage-dir html
사용 istanbul help report
(다음은 이스탄불 0.4.5 생성됩니다) :
Usage: istanbul report <options> [ <format> ... ]
Options are:
--config <path-to-config>
the configuration file to use, defaults to .istanbul.yml
--root <input-directory>
The input root directory for finding coverage files
--dir <report-directory>
The output directory where files will be written. This defaults
to ./coverage/
--include <glob>
The glob pattern to select one or more coverage files, defaults
to **/coverage*.json
--verbose, -v
verbose mode
<format> is one of
clover XML coverage report that can be consumed by the clover tool
cobertura
XML coverage report that can be consumed by the cobertura tool
html Navigable HTML coverage report for every file and directory
json prints the coverage object as JSON to a file
json-summary
prints a summary coverage object as JSON to a file
lcov combined lcovonly and html report that generates an lcov.info
file as well as HTML
lcovonly
lcov coverage report that can be consumed by the lcov tool
none Does nothing. Useful to override default behavior and suppress
reporting entirely
teamcity
report with system messages that can be interpreted with TeamCity
text text report that prints a coverage line for every file, typically
to console
text-lcov
lcov coverage report that can be consumed by the lcov tool
text-summary
text report that prints a coverage summary across all files,
typically to console
Default format is lcov unless otherwise specified in the config file. In
addition you can tweak the file names for various reports using the config
file. Type `istanbul help config` to see what can be tweaked.
--input
의 값은 glob 패턴입니다. glob 패턴에 대한 자세한 내용은 documentation at the glob
package on NPM을 참조하십시오.