summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration_tests.rs6
-rw-r--r--cli/tests/test/doc.out5
-rw-r--r--cli/tests/test/doc.ts10
3 files changed, 21 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index cfb450678..56043930b 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -2580,6 +2580,12 @@ mod integration {
output: "test/deno_test.out",
});
+ itest!(doc {
+ args: "test --doc --allow-all test/doc.ts",
+ exit_code: 1,
+ output: "test/doc.out",
+ });
+
itest!(allow_all {
args: "test --unstable --allow-all test/allow_all.ts",
exit_code: 0,
diff --git a/cli/tests/test/doc.out b/cli/tests/test/doc.out
new file mode 100644
index 000000000..0f3d02aa3
--- /dev/null
+++ b/cli/tests/test/doc.out
@@ -0,0 +1,5 @@
+Check [WILDCARD]/doc.ts:2-7
+error: TS2367 [ERROR]: This condition will always return 'false' since the types 'string' and 'number' have no overlap.
+console.assert(example() == 42);
+ ~~~~~~~~~~~~~~~
+ at [WILDCARD]/doc.ts:2-7.ts:3:16
diff --git a/cli/tests/test/doc.ts b/cli/tests/test/doc.ts
new file mode 100644
index 000000000..9298393eb
--- /dev/null
+++ b/cli/tests/test/doc.ts
@@ -0,0 +1,10 @@
+/**
+ * ```
+ * import { example } from "./doc.ts";
+ *
+ * console.assert(example() == 42);
+ * ```
+ */
+export function example(): string {
+ return "example";
+}