summaryrefslogtreecommitdiff
path: root/tests/testdata/coverage
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-02-10 13:22:13 -0700
committerGitHub <noreply@github.com>2024-02-10 20:22:13 +0000
commitf5e46c9bf2f50d66a953fa133161fc829cecff06 (patch)
tree8faf2f5831c1c7b11d842cd9908d141082c869a5 /tests/testdata/coverage
parentd2477f780630a812bfd65e3987b70c0d309385bb (diff)
chore: move cli/tests/ -> tests/ (#22369)
This looks like a massive PR, but it's only a move from cli/tests -> tests, and updates of relative paths for files. This is the first step towards aggregate all of the integration test files under tests/, which will lead to a set of integration tests that can run without the CLI binary being built. While we could leave these tests under `cli`, it would require us to keep a more complex directory structure for the various test runners. In addition, we have a lot of complexity to ignore various test files in the `cli` project itself (cargo publish exclusion rules, autotests = false, etc). And finally, the `tests/` folder will eventually house the `test_ffi`, `test_napi` and other testing code, reducing the size of the root repo directory. For easier review, the extremely large and noisy "move" is in the first commit (with no changes -- just a move), while the remainder of the changes to actual files is in the second commit.
Diffstat (limited to 'tests/testdata/coverage')
-rw-r--r--tests/testdata/coverage/branch.ts15
-rw-r--r--tests/testdata/coverage/branch_expected.lcov27
-rw-r--r--tests/testdata/coverage/branch_expected.out12
-rw-r--r--tests/testdata/coverage/branch_test.ts5
-rw-r--r--tests/testdata/coverage/complex.ts74
-rw-r--r--tests/testdata/coverage/complex_expected.lcov67
-rw-r--r--tests/testdata/coverage/complex_expected.out20
-rw-r--r--tests/testdata/coverage/complex_test.ts39
-rw-r--r--tests/testdata/coverage/doesnt_exist.out1
-rw-r--r--tests/testdata/coverage/final_blankline.js5
-rw-r--r--tests/testdata/coverage/final_blankline_expected.lcov16
-rw-r--r--tests/testdata/coverage/final_blankline_expected.out1
-rw-r--r--tests/testdata/coverage/final_blankline_test.js5
-rw-r--r--tests/testdata/coverage/invalid_cache/mod.test.ts2
-rw-r--r--tests/testdata/coverage/invalid_cache/mod_after.ts6
-rw-r--r--tests/testdata/coverage/invalid_cache/mod_before.ts15
-rw-r--r--tests/testdata/coverage/multifile/a_test.js8
-rw-r--r--tests/testdata/coverage/multifile/b_test.js8
-rw-r--r--tests/testdata/coverage/multifile/expected.lcov18
-rw-r--r--tests/testdata/coverage/multifile/expected.out1
-rw-r--r--tests/testdata/coverage/multifile/mod.js6
-rw-r--r--tests/testdata/coverage/multisource/bar.ts7
-rw-r--r--tests/testdata/coverage/multisource/baz/quux.ts14
-rw-r--r--tests/testdata/coverage/multisource/baz/qux.ts7
-rw-r--r--tests/testdata/coverage/multisource/foo.ts14
-rw-r--r--tests/testdata/coverage/multisource/test.ts22
-rw-r--r--tests/testdata/coverage/no_internal_code_test.ts7
-rw-r--r--tests/testdata/coverage/no_internal_node_code_test.ts8
-rw-r--r--tests/testdata/coverage/no_npm_coverage/expected.out1
-rw-r--r--tests/testdata/coverage/no_npm_coverage/no_npm_coverage.ts4
-rw-r--r--tests/testdata/coverage/no_npm_coverage/no_npm_coverage_test.ts4
-rw-r--r--tests/testdata/coverage/no_snaps_included/__snapshots__/no_snaps_included_test.ts.snap3
-rw-r--r--tests/testdata/coverage/no_snaps_included/expected.out1
-rw-r--r--tests/testdata/coverage/no_snaps_included/no_snaps_included.ts3
-rw-r--r--tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts11
-rw-r--r--tests/testdata/coverage/no_tests_included/expected.out1
-rw-r--r--tests/testdata/coverage/no_tests_included/foo.test.js6
-rw-r--r--tests/testdata/coverage/no_tests_included/foo.test.mts6
-rw-r--r--tests/testdata/coverage/no_tests_included/foo.test.ts6
-rw-r--r--tests/testdata/coverage/no_tests_included/foo.ts3
-rw-r--r--tests/testdata/coverage/no_transpiled_lines/expected.lcov10
-rw-r--r--tests/testdata/coverage/no_transpiled_lines/expected.out1
-rw-r--r--tests/testdata/coverage/no_transpiled_lines/index.ts3
-rw-r--r--tests/testdata/coverage/no_transpiled_lines/interface.ts3
-rw-r--r--tests/testdata/coverage/no_transpiled_lines/repro_test.ts7
45 files changed, 503 insertions, 0 deletions
diff --git a/tests/testdata/coverage/branch.ts b/tests/testdata/coverage/branch.ts
new file mode 100644
index 000000000..352167109
--- /dev/null
+++ b/tests/testdata/coverage/branch.ts
@@ -0,0 +1,15 @@
+export function branch(condition: boolean): boolean {
+ if (condition) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+export function unused(condition: boolean): boolean {
+ if (condition) {
+ return false;
+ } else {
+ return true;
+ }
+}
diff --git a/tests/testdata/coverage/branch_expected.lcov b/tests/testdata/coverage/branch_expected.lcov
new file mode 100644
index 000000000..fb3454210
--- /dev/null
+++ b/tests/testdata/coverage/branch_expected.lcov
@@ -0,0 +1,27 @@
+SF:[WILDCARD]branch.ts
+FN:1,branch
+FN:9,unused
+FNDA:1,branch
+FNDA:0,unused
+FNF:2
+FNH:1
+BRDA:4,1,0,0
+BRF:1
+BRH:0
+DA:1,1
+DA:2,2
+DA:3,2
+DA:4,0
+DA:5,0
+DA:6,0
+DA:7,2
+DA:9,0
+DA:10,0
+DA:11,0
+DA:12,0
+DA:13,0
+DA:14,0
+DA:15,0
+LH:4
+LF:14
+end_of_record
diff --git a/tests/testdata/coverage/branch_expected.out b/tests/testdata/coverage/branch_expected.out
new file mode 100644
index 000000000..630ea93b2
--- /dev/null
+++ b/tests/testdata/coverage/branch_expected.out
@@ -0,0 +1,12 @@
+cover [WILDCARD]/coverage/branch.ts ... 28.571% (4/14)
+ 4 | } else {
+ 5 | return false;
+ 6 | }
+-----|-----
+ 9 | export function unused(condition: boolean): boolean {
+ 10 | if (condition) {
+ 11 | return false;
+ 12 | } else {
+ 13 | return true;
+ 14 | }
+ 15 | }
diff --git a/tests/testdata/coverage/branch_test.ts b/tests/testdata/coverage/branch_test.ts
new file mode 100644
index 000000000..2a44c8071
--- /dev/null
+++ b/tests/testdata/coverage/branch_test.ts
@@ -0,0 +1,5 @@
+import { branch } from "./branch.ts";
+
+Deno.test("branch", function () {
+ branch(true);
+});
diff --git a/tests/testdata/coverage/complex.ts b/tests/testdata/coverage/complex.ts
new file mode 100644
index 000000000..d128b5437
--- /dev/null
+++ b/tests/testdata/coverage/complex.ts
@@ -0,0 +1,74 @@
+// This entire interface should be completely ignored by the coverage tool.
+export interface Complex {
+ // These comments should be ignored.
+ foo: string;
+
+ // But this is a stub, so this isn't really documentation.
+ bar: string;
+
+ // Really all these are doing is padding the line count.
+ baz: string;
+}
+
+// Lets add some wide characters to ensure that the absolute byte offsets are
+// being matched properly.
+//
+// 패딩에 대한 더 많은 문자.
+function dependency(
+ foo: string,
+ bar: string,
+ baz: string,
+): Complex {
+ return {
+ foo,
+ bar,
+ baz,
+ };
+}
+
+// Again just more wide characters for padding.
+//
+// 良い対策のためにいくつかのユニコード文字を投げる。
+export function complex(
+ foo: string,
+ bar: string,
+ baz: string,
+): Complex {
+ return dependency(
+ foo,
+ bar,
+ baz,
+ );
+}
+
+// And yet again for good measure.
+// 更多用於填充的字元。
+export function unused(
+ foo: string,
+ bar: string,
+ baz: string,
+): Complex {
+ return complex(
+ foo,
+ bar,
+ baz,
+ );
+}
+
+// Using a non-ascii name again to ensure that the byte offsets match up
+// correctly.
+export const π = Math.PI;
+
+// And same applies for this one, this one is unused and will show up in
+// lacking coverage.
+export function ƒ(): number {
+ return (
+ 0
+ );
+}
+
+// This arrow function should also show up as uncovered.
+console.log("%s", () => 1);
+
+// Make sure emojis work properly
+console.log("📣❓");
diff --git a/tests/testdata/coverage/complex_expected.lcov b/tests/testdata/coverage/complex_expected.lcov
new file mode 100644
index 000000000..94b86465a
--- /dev/null
+++ b/tests/testdata/coverage/complex_expected.lcov
@@ -0,0 +1,67 @@
+SF:[WILDCARD]complex.ts
+FN:17,dependency
+FN:32,complex
+FN:46,unused
+FN:64,ƒ
+FNDA:1,dependency
+FNDA:1,complex
+FNDA:0,unused
+FNDA:0,ƒ
+FNF:4
+FNH:2
+BRF:0
+BRH:0
+DA:1,1
+DA:13,1
+DA:14,1
+DA:15,1
+DA:16,1
+DA:17,2
+DA:18,2
+DA:19,2
+DA:20,2
+DA:22,2
+DA:23,2
+DA:24,2
+DA:25,2
+DA:26,2
+DA:27,2
+DA:29,1
+DA:30,1
+DA:31,1
+DA:32,1
+DA:33,1
+DA:34,1
+DA:35,1
+DA:37,2
+DA:38,2
+DA:39,2
+DA:40,2
+DA:42,2
+DA:44,1
+DA:45,1
+DA:46,0
+DA:47,0
+DA:48,0
+DA:49,0
+DA:51,0
+DA:52,0
+DA:53,0
+DA:54,0
+DA:56,0
+DA:58,1
+DA:59,1
+DA:60,1
+DA:62,1
+DA:63,1
+DA:64,0
+DA:65,0
+DA:66,0
+DA:68,0
+DA:70,1
+DA:71,0
+DA:73,1
+DA:74,1
+LH:37
+LF:51
+end_of_record
diff --git a/tests/testdata/coverage/complex_expected.out b/tests/testdata/coverage/complex_expected.out
new file mode 100644
index 000000000..3d5f6a0ab
--- /dev/null
+++ b/tests/testdata/coverage/complex_expected.out
@@ -0,0 +1,20 @@
+cover [WILDCARD]/coverage/complex.ts ... 72.549% (37/51)
+ 46 | export function unused(
+ 47 | foo: string,
+ 48 | bar: string,
+ 49 | baz: string,
+-----|-----
+ 51 | return complex(
+ 52 | foo,
+ 53 | bar,
+ 54 | baz,
+-----|-----
+ 56 | }
+-----|-----
+ 64 | export function ƒ(): number {
+ 65 | return (
+ 66 | 0
+-----|-----
+ 68 | }
+-----|-----
+ 71 | console.log("%s", () => 1);
diff --git a/tests/testdata/coverage/complex_test.ts b/tests/testdata/coverage/complex_test.ts
new file mode 100644
index 000000000..d6e9c2691
--- /dev/null
+++ b/tests/testdata/coverage/complex_test.ts
@@ -0,0 +1,39 @@
+import { complex } from "./complex.ts";
+
+Deno.test("complex", function () {
+ complex("foo", "bar", "baz");
+});
+
+Deno.test("sub process with stdin", async () => {
+ // ensure launching deno run with stdin doesn't affect coverage
+ const code = "console.log('5')";
+ // deno-lint-ignore no-deprecated-deno-api
+ const p = await Deno.run({
+ cmd: [Deno.execPath(), "run", "-"],
+ stdin: "piped",
+ stdout: "piped",
+ });
+ const encoder = new TextEncoder();
+ await p.stdin.write(encoder.encode(code));
+ await p.stdin.close();
+ const output = new TextDecoder().decode(await p.output());
+ p.close();
+ if (output.trim() !== "5") {
+ throw new Error("Failed");
+ }
+});
+
+Deno.test("sub process with deno eval", async () => {
+ // ensure launching deno eval doesn't affect coverage
+ const code = "console.log('5')";
+ // deno-lint-ignore no-deprecated-deno-api
+ const p = await Deno.run({
+ cmd: [Deno.execPath(), "eval", code],
+ stdout: "piped",
+ });
+ const output = new TextDecoder().decode(await p.output());
+ p.close();
+ if (output.trim() !== "5") {
+ throw new Error("Failed");
+ }
+});
diff --git a/tests/testdata/coverage/doesnt_exist.out b/tests/testdata/coverage/doesnt_exist.out
new file mode 100644
index 000000000..0b679bcb4
--- /dev/null
+++ b/tests/testdata/coverage/doesnt_exist.out
@@ -0,0 +1 @@
+error: No coverage files found
diff --git a/tests/testdata/coverage/final_blankline.js b/tests/testdata/coverage/final_blankline.js
new file mode 100644
index 000000000..bb5ab0378
--- /dev/null
+++ b/tests/testdata/coverage/final_blankline.js
@@ -0,0 +1,5 @@
+// deno-fmt-ignore-file - has blankline at end
+export default function example() {
+ return true;
+}
+
diff --git a/tests/testdata/coverage/final_blankline_expected.lcov b/tests/testdata/coverage/final_blankline_expected.lcov
new file mode 100644
index 000000000..48af66180
--- /dev/null
+++ b/tests/testdata/coverage/final_blankline_expected.lcov
@@ -0,0 +1,16 @@
+SF:[WILDCARD]final_blankline.js
+FN:2,example
+FNDA:1,example
+FNF:1
+FNH:1
+BRF:0
+BRH:0
+DA:1,1
+DA:2,1
+DA:3,2
+DA:4,2
+DA:5,1
+DA:6,1
+LH:6
+LF:6
+end_of_record
diff --git a/tests/testdata/coverage/final_blankline_expected.out b/tests/testdata/coverage/final_blankline_expected.out
new file mode 100644
index 000000000..8dc5ce30d
--- /dev/null
+++ b/tests/testdata/coverage/final_blankline_expected.out
@@ -0,0 +1 @@
+cover file:///[WILDCARD]final_blankline.js ... 100.000% (6/6)
diff --git a/tests/testdata/coverage/final_blankline_test.js b/tests/testdata/coverage/final_blankline_test.js
new file mode 100644
index 000000000..e7331c537
--- /dev/null
+++ b/tests/testdata/coverage/final_blankline_test.js
@@ -0,0 +1,5 @@
+import example from "./final_blankline.js";
+
+Deno.test("Example.", () => {
+ example();
+});
diff --git a/tests/testdata/coverage/invalid_cache/mod.test.ts b/tests/testdata/coverage/invalid_cache/mod.test.ts
new file mode 100644
index 000000000..5815d07a3
--- /dev/null
+++ b/tests/testdata/coverage/invalid_cache/mod.test.ts
@@ -0,0 +1,2 @@
+import { test } from "./mod.ts";
+Deno.test("test", () => void test());
diff --git a/tests/testdata/coverage/invalid_cache/mod_after.ts b/tests/testdata/coverage/invalid_cache/mod_after.ts
new file mode 100644
index 000000000..294dc0843
--- /dev/null
+++ b/tests/testdata/coverage/invalid_cache/mod_after.ts
@@ -0,0 +1,6 @@
+export function test() {
+ return 42;
+}
+if (import.meta.main) {
+ test();
+}
diff --git a/tests/testdata/coverage/invalid_cache/mod_before.ts b/tests/testdata/coverage/invalid_cache/mod_before.ts
new file mode 100644
index 000000000..ea52ccbce
--- /dev/null
+++ b/tests/testdata/coverage/invalid_cache/mod_before.ts
@@ -0,0 +1,15 @@
+export function test() {
+ console.log("1");
+ console.log("2");
+ console.log("3");
+ console.log("4");
+ console.log("5");
+ console.log("6");
+ console.log("7");
+ console.log("8");
+ console.log("9");
+ return 42;
+}
+if (import.meta.main) {
+ test();
+}
diff --git a/tests/testdata/coverage/multifile/a_test.js b/tests/testdata/coverage/multifile/a_test.js
new file mode 100644
index 000000000..d5d9c3533
--- /dev/null
+++ b/tests/testdata/coverage/multifile/a_test.js
@@ -0,0 +1,8 @@
+import { test } from "./mod.js";
+
+Deno.test({
+ name: "bugrepo a",
+ fn: () => {
+ test(true);
+ },
+});
diff --git a/tests/testdata/coverage/multifile/b_test.js b/tests/testdata/coverage/multifile/b_test.js
new file mode 100644
index 000000000..d93b15a17
--- /dev/null
+++ b/tests/testdata/coverage/multifile/b_test.js
@@ -0,0 +1,8 @@
+import { test } from "./mod.js";
+
+Deno.test({
+ name: "bugrepo b",
+ fn: () => {
+ test(false);
+ },
+});
diff --git a/tests/testdata/coverage/multifile/expected.lcov b/tests/testdata/coverage/multifile/expected.lcov
new file mode 100644
index 000000000..03ad5e7bd
--- /dev/null
+++ b/tests/testdata/coverage/multifile/expected.lcov
@@ -0,0 +1,18 @@
+SF:[WILDCARD]mod.js
+FN:1,test
+FNDA:2,test
+FNF:1
+FNH:1
+BRDA:2,1,0,1
+BRF:1
+BRH:1
+DA:1,2
+DA:2,4
+DA:3,5
+DA:4,5
+DA:5,5
+DA:6,4
+DA:7,1
+LH:7
+LF:7
+end_of_record
diff --git a/tests/testdata/coverage/multifile/expected.out b/tests/testdata/coverage/multifile/expected.out
new file mode 100644
index 000000000..fde26e165
--- /dev/null
+++ b/tests/testdata/coverage/multifile/expected.out
@@ -0,0 +1 @@
+cover [WILDCARD]/multifile/mod.js ... 100.000% (7/7)
diff --git a/tests/testdata/coverage/multifile/mod.js b/tests/testdata/coverage/multifile/mod.js
new file mode 100644
index 000000000..b9f8d627a
--- /dev/null
+++ b/tests/testdata/coverage/multifile/mod.js
@@ -0,0 +1,6 @@
+export function test(a) {
+ if (a) {
+ return 0;
+ }
+ return 1;
+}
diff --git a/tests/testdata/coverage/multisource/bar.ts b/tests/testdata/coverage/multisource/bar.ts
new file mode 100644
index 000000000..123937b0b
--- /dev/null
+++ b/tests/testdata/coverage/multisource/bar.ts
@@ -0,0 +1,7 @@
+export function bar<T>(cond: T) {
+ if (cond) {
+ return 1;
+ } else {
+ return 2;
+ }
+}
diff --git a/tests/testdata/coverage/multisource/baz/quux.ts b/tests/testdata/coverage/multisource/baz/quux.ts
new file mode 100644
index 000000000..6032f6f3c
--- /dev/null
+++ b/tests/testdata/coverage/multisource/baz/quux.ts
@@ -0,0 +1,14 @@
+export function quux(cond: boolean) {
+ if (cond) {
+ const a = 1;
+ const b = a;
+ const c = b;
+ const d = c;
+ const e = d;
+ const f = e;
+ const g = f;
+ return g;
+ } else {
+ return 2;
+ }
+}
diff --git a/tests/testdata/coverage/multisource/baz/qux.ts b/tests/testdata/coverage/multisource/baz/qux.ts
new file mode 100644
index 000000000..973f48c61
--- /dev/null
+++ b/tests/testdata/coverage/multisource/baz/qux.ts
@@ -0,0 +1,7 @@
+export function qux(cond: boolean) {
+ if (cond) {
+ return 1;
+ } else {
+ return 2;
+ }
+}
diff --git a/tests/testdata/coverage/multisource/foo.ts b/tests/testdata/coverage/multisource/foo.ts
new file mode 100644
index 000000000..0559cadd8
--- /dev/null
+++ b/tests/testdata/coverage/multisource/foo.ts
@@ -0,0 +1,14 @@
+export function foo(cond: boolean) {
+ let a = 0;
+ if (cond) {
+ a = 1;
+ } else {
+ a = 2;
+ }
+
+ if (a == 4) {
+ return 1;
+ } else {
+ return 2;
+ }
+}
diff --git a/tests/testdata/coverage/multisource/test.ts b/tests/testdata/coverage/multisource/test.ts
new file mode 100644
index 000000000..350421177
--- /dev/null
+++ b/tests/testdata/coverage/multisource/test.ts
@@ -0,0 +1,22 @@
+import { foo } from "./foo.ts";
+import { bar } from "./bar.ts";
+import { qux } from "./baz/qux.ts";
+import { quux } from "./baz/quux.ts";
+
+Deno.test("foo", () => {
+ foo(true);
+ foo(false);
+});
+
+Deno.test("bar", () => {
+ bar(false);
+});
+
+Deno.test("qux", () => {
+ qux(true);
+ qux(false);
+});
+
+Deno.test("quux", () => {
+ quux(false);
+});
diff --git a/tests/testdata/coverage/no_internal_code_test.ts b/tests/testdata/coverage/no_internal_code_test.ts
new file mode 100644
index 000000000..0cf46d252
--- /dev/null
+++ b/tests/testdata/coverage/no_internal_code_test.ts
@@ -0,0 +1,7 @@
+const add = (a: number, b: number) => a + b;
+
+Deno.test(function addTest() {
+ if (add(2, 3) !== 5) {
+ throw new Error("fail");
+ }
+});
diff --git a/tests/testdata/coverage/no_internal_node_code_test.ts b/tests/testdata/coverage/no_internal_node_code_test.ts
new file mode 100644
index 000000000..dc53e0c52
--- /dev/null
+++ b/tests/testdata/coverage/no_internal_node_code_test.ts
@@ -0,0 +1,8 @@
+import * as path from "node:path";
+
+Deno.test(function test() {
+ const res = path.join("foo", "bar");
+ if (!res.includes("foo")) {
+ throw new Error("fail");
+ }
+});
diff --git a/tests/testdata/coverage/no_npm_coverage/expected.out b/tests/testdata/coverage/no_npm_coverage/expected.out
new file mode 100644
index 000000000..ca4511277
--- /dev/null
+++ b/tests/testdata/coverage/no_npm_coverage/expected.out
@@ -0,0 +1 @@
+cover [WILDCARD]/no_npm_coverage/no_npm_coverage.ts ... 100.000% (4/4)
diff --git a/tests/testdata/coverage/no_npm_coverage/no_npm_coverage.ts b/tests/testdata/coverage/no_npm_coverage/no_npm_coverage.ts
new file mode 100644
index 000000000..4233b2e5d
--- /dev/null
+++ b/tests/testdata/coverage/no_npm_coverage/no_npm_coverage.ts
@@ -0,0 +1,4 @@
+import chalk from "npm:chalk";
+export function main() {
+ console.log(chalk.red("RED"));
+}
diff --git a/tests/testdata/coverage/no_npm_coverage/no_npm_coverage_test.ts b/tests/testdata/coverage/no_npm_coverage/no_npm_coverage_test.ts
new file mode 100644
index 000000000..8305f9597
--- /dev/null
+++ b/tests/testdata/coverage/no_npm_coverage/no_npm_coverage_test.ts
@@ -0,0 +1,4 @@
+import { main } from "./no_npm_coverage.ts";
+Deno.test("main", () => {
+ main();
+});
diff --git a/tests/testdata/coverage/no_snaps_included/__snapshots__/no_snaps_included_test.ts.snap b/tests/testdata/coverage/no_snaps_included/__snapshots__/no_snaps_included_test.ts.snap
new file mode 100644
index 000000000..b7bfe6b8b
--- /dev/null
+++ b/tests/testdata/coverage/no_snaps_included/__snapshots__/no_snaps_included_test.ts.snap
@@ -0,0 +1,3 @@
+export const snapshot = {};
+
+snapshot[`snapshot excluded from coverage 1`] = `{}`;
diff --git a/tests/testdata/coverage/no_snaps_included/expected.out b/tests/testdata/coverage/no_snaps_included/expected.out
new file mode 100644
index 000000000..83979a752
--- /dev/null
+++ b/tests/testdata/coverage/no_snaps_included/expected.out
@@ -0,0 +1 @@
+cover [WILDCARD]/no_snaps_included/no_snaps_included.ts ... 100.000% (3/3)
diff --git a/tests/testdata/coverage/no_snaps_included/no_snaps_included.ts b/tests/testdata/coverage/no_snaps_included/no_snaps_included.ts
new file mode 100644
index 000000000..2d844150b
--- /dev/null
+++ b/tests/testdata/coverage/no_snaps_included/no_snaps_included.ts
@@ -0,0 +1,3 @@
+export function truth() {
+ return true;
+}
diff --git a/tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts b/tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts
new file mode 100644
index 000000000..6fb44fcc6
--- /dev/null
+++ b/tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts
@@ -0,0 +1,11 @@
+import { assertSnapshot } from "../../../../test_util/std/testing/snapshot.ts";
+import { truth } from "./no_snaps_included.ts";
+
+Deno.test("the truth", () => {
+ truth();
+});
+
+// Create snapshot in .snap file, but it shouldn't be in the coverage output
+Deno.test("snapshot excluded from coverage", async (context) => {
+ await assertSnapshot(context, {});
+});
diff --git a/tests/testdata/coverage/no_tests_included/expected.out b/tests/testdata/coverage/no_tests_included/expected.out
new file mode 100644
index 000000000..3b2469f2d
--- /dev/null
+++ b/tests/testdata/coverage/no_tests_included/expected.out
@@ -0,0 +1 @@
+cover [WILDCARD]/no_tests_included/foo.ts ... 100.000% (3/3)
diff --git a/tests/testdata/coverage/no_tests_included/foo.test.js b/tests/testdata/coverage/no_tests_included/foo.test.js
new file mode 100644
index 000000000..46dd037be
--- /dev/null
+++ b/tests/testdata/coverage/no_tests_included/foo.test.js
@@ -0,0 +1,6 @@
+import { addNumbers } from "./foo.ts";
+import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
+
+Deno.test("addNumbers works", () => {
+ assertEquals(addNumbers(1, 2), 3);
+});
diff --git a/tests/testdata/coverage/no_tests_included/foo.test.mts b/tests/testdata/coverage/no_tests_included/foo.test.mts
new file mode 100644
index 000000000..46dd037be
--- /dev/null
+++ b/tests/testdata/coverage/no_tests_included/foo.test.mts
@@ -0,0 +1,6 @@
+import { addNumbers } from "./foo.ts";
+import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
+
+Deno.test("addNumbers works", () => {
+ assertEquals(addNumbers(1, 2), 3);
+});
diff --git a/tests/testdata/coverage/no_tests_included/foo.test.ts b/tests/testdata/coverage/no_tests_included/foo.test.ts
new file mode 100644
index 000000000..46dd037be
--- /dev/null
+++ b/tests/testdata/coverage/no_tests_included/foo.test.ts
@@ -0,0 +1,6 @@
+import { addNumbers } from "./foo.ts";
+import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
+
+Deno.test("addNumbers works", () => {
+ assertEquals(addNumbers(1, 2), 3);
+});
diff --git a/tests/testdata/coverage/no_tests_included/foo.ts b/tests/testdata/coverage/no_tests_included/foo.ts
new file mode 100644
index 000000000..fc2860ef0
--- /dev/null
+++ b/tests/testdata/coverage/no_tests_included/foo.ts
@@ -0,0 +1,3 @@
+export function addNumbers(a: number, b: number): number {
+ return a + b;
+}
diff --git a/tests/testdata/coverage/no_transpiled_lines/expected.lcov b/tests/testdata/coverage/no_transpiled_lines/expected.lcov
new file mode 100644
index 000000000..480945d14
--- /dev/null
+++ b/tests/testdata/coverage/no_transpiled_lines/expected.lcov
@@ -0,0 +1,10 @@
+SF:[WILDCARD]index.ts
+FNF:0
+FNH:0
+BRF:0
+BRH:0
+DA:1,1
+DA:3,1
+LH:2
+LF:2
+end_of_record
diff --git a/tests/testdata/coverage/no_transpiled_lines/expected.out b/tests/testdata/coverage/no_transpiled_lines/expected.out
new file mode 100644
index 000000000..3438a045c
--- /dev/null
+++ b/tests/testdata/coverage/no_transpiled_lines/expected.out
@@ -0,0 +1 @@
+cover [WILDCARD]index.ts ... 100.000% (2/2)
diff --git a/tests/testdata/coverage/no_transpiled_lines/index.ts b/tests/testdata/coverage/no_transpiled_lines/index.ts
new file mode 100644
index 000000000..8b87e7680
--- /dev/null
+++ b/tests/testdata/coverage/no_transpiled_lines/index.ts
@@ -0,0 +1,3 @@
+export { assertStrictEquals } from "../../../../test_util/std/assert/mod.ts";
+
+export * from "./interface.ts";
diff --git a/tests/testdata/coverage/no_transpiled_lines/interface.ts b/tests/testdata/coverage/no_transpiled_lines/interface.ts
new file mode 100644
index 000000000..6e58a7b2f
--- /dev/null
+++ b/tests/testdata/coverage/no_transpiled_lines/interface.ts
@@ -0,0 +1,3 @@
+export interface TestInterface {
+ id: string;
+}
diff --git a/tests/testdata/coverage/no_transpiled_lines/repro_test.ts b/tests/testdata/coverage/no_transpiled_lines/repro_test.ts
new file mode 100644
index 000000000..ca4a0d17f
--- /dev/null
+++ b/tests/testdata/coverage/no_transpiled_lines/repro_test.ts
@@ -0,0 +1,7 @@
+import { assertStrictEquals, TestInterface } from "./index.ts";
+
+Deno.test(function noTranspiledLines() {
+ const foo: TestInterface = { id: "id" };
+
+ assertStrictEquals(foo.id, "id");
+});