From 0ef1c774f6ed00d6cbe2de1ebd3f12da6c949394 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Sun, 26 May 2024 13:22:57 +0900 Subject: fix(coverage): add tooltip to line count in html report (#23971) closes #21582 --- tests/integration/coverage_tests.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/integration/coverage_tests.rs') diff --git a/tests/integration/coverage_tests.rs b/tests/integration/coverage_tests.rs index ae732f25f..f6011b054 100644 --- a/tests/integration/coverage_tests.rs +++ b/tests/integration/coverage_tests.rs @@ -441,6 +441,12 @@ fn no_internal_node_code() { #[test] fn test_html_reporter() { + // This test case generates a html coverage report of test cases in /tests/testdata/coverage/multisource + // You can get the same reports in ./cov_html by running the following command: + // ``` + // ./target/debug/deno test --coverage=cov_html tests/testdata/coverage/multisource + // ./target/debug/deno coverage --html cov_html + // ``` let context = TestContext::default(); let tempdir = context.temp_dir(); let tempdir = tempdir.path().join("cov"); @@ -481,6 +487,9 @@ fn test_html_reporter() { let foo_ts_html = tempdir.join("html").join("foo.ts.html").read_to_string(); assert_contains!(foo_ts_html, "

Coverage report for foo.ts

"); + // Check that line count has correct title attribute + assert_contains!(foo_ts_html, "x1"); + assert_contains!(foo_ts_html, "x3"); let bar_ts_html = tempdir.join("html").join("bar.ts.html").read_to_string(); assert_contains!(bar_ts_html, "

Coverage report for bar.ts

"); -- cgit v1.2.3