summaryrefslogtreecommitdiff
path: root/cli/tests/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r--cli/tests/testdata/test/markdown_with_comment.md36
-rw-r--r--cli/tests/testdata/test/markdown_with_comment.out5
2 files changed, 41 insertions, 0 deletions
diff --git a/cli/tests/testdata/test/markdown_with_comment.md b/cli/tests/testdata/test/markdown_with_comment.md
new file mode 100644
index 000000000..886e88103
--- /dev/null
+++ b/cli/tests/testdata/test/markdown_with_comment.md
@@ -0,0 +1,36 @@
+# Documentation
+
+The following examples are inside HTML comments and will not trigger the
+type-checker:
+
+<!-- ```ts ignore
+const value: Invalid = "ignored";
+``` -->
+
+<!--
+```ts
+const a: string = 42;
+```
+-->
+
+<!--
+
+This is a comment.
+
+```ts
+const a: string = 42;
+```
+
+Something something more comments.
+
+```typescript
+const a: boolean = "true";
+```
+
+-->
+
+The following example will trigger the type-checker to fail:
+
+```ts
+const a: string = 42;
+```
diff --git a/cli/tests/testdata/test/markdown_with_comment.out b/cli/tests/testdata/test/markdown_with_comment.out
new file mode 100644
index 000000000..b202919d8
--- /dev/null
+++ b/cli/tests/testdata/test/markdown_with_comment.out
@@ -0,0 +1,5 @@
+Check [WILDCARD]/test/markdown_with_comment.md$34-37.ts
+error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
+const a: string = 42;
+ ^
+ at [WILDCARD]/test/markdown_with_comment.md$34-37.ts:1:7