summaryrefslogtreecommitdiff
path: root/docs/testing.md
diff options
context:
space:
mode:
authorLuca Casonato <lucacasonato@yahoo.com>2020-09-13 15:17:25 +0200
committerGitHub <noreply@github.com>2020-09-13 15:17:25 +0200
commitf06724f2388180c1d73eb0cc989f3499d84eb879 (patch)
treee1b2df4c22cae0d739d03f8e86aae6fe237a6fec /docs/testing.md
parent755cfa98ebf4e3bd96e432d6a0b761aeb2e3c818 (diff)
docs: manual updates for 1.4 features and changes (#7440)
Diffstat (limited to 'docs/testing.md')
-rw-r--r--docs/testing.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/testing.md b/docs/testing.md
index bb2790670..db81ee341 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -204,3 +204,29 @@ failure, you can specify the `--failfast` flag when running the suite.
```shell
deno test --failfast
```
+
+## Test coverage
+
+Deno will automatically determine test coverage for your code if you specify the
+`--coverage` flag when starting `deno test`. Coverage is determined on a line by
+line basis, and is acquired directly from the JavaScript runtime (V8). Because
+of this, this coverage is very accurate.
+
+When all tests are done running a summary of coverage per file is printed to
+stdout. In the future there will be support for `lcov` output too.
+
+```
+$ git clone git@github.com:denosaurs/deno_brotli.git && cd deno_brotli
+$ deno test --coverage --unstable
+Debugger listening on ws://127.0.0.1:9229/ws/5a593019-d185-478b-a928-ebc33e5834be
+Check file:///home/deno/deno_brotli/.deno.test.ts
+running 2 tests
+test compress ... ok (26ms)
+test decompress ... ok (13ms)
+
+test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (40ms)
+
+test coverage:
+file:///home/deno/deno_brotli/mod.ts 100.000%
+file:///home/deno/deno_brotli/wasm.js 100.000%
+```