diff options
| author | Geert-Jan Zwiers <34610306+GJZwiers@users.noreply.github.com> | 2021-11-15 15:58:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-15 09:58:04 -0500 |
| commit | 58e7b290dccbf06abb882daf2ae2b4c1df96f73f (patch) | |
| tree | 5a404da1b79629758195dd5c3bb103fe30bddaa9 /cli/tests/testdata | |
| parent | dd91ecef502456ba39495d8e178f8101a87c0e34 (diff) | |
fix(test): support typechecking docs with CRLF line endings (#12748)
Diffstat (limited to 'cli/tests/testdata')
| -rw-r--r-- | cli/tests/testdata/test/markdown_windows.md | 31 | ||||
| -rw-r--r-- | cli/tests/testdata/test/markdown_windows.out | 7 |
2 files changed, 38 insertions, 0 deletions
diff --git a/cli/tests/testdata/test/markdown_windows.md b/cli/tests/testdata/test/markdown_windows.md new file mode 100644 index 000000000..d18dbd108 --- /dev/null +++ b/cli/tests/testdata/test/markdown_windows.md @@ -0,0 +1,31 @@ +# Documentation + +The following block does not have a language attribute and should be ignored: + +``` +This is a fenced block without attributes, it's invalid and it should be ignored. +``` + +The following block should be given a js extension on extraction: + +```js +console.log("js"); +``` + +The following block should be given a ts extension on extraction: + +```ts +console.log("ts"); +``` + +The following example contains the ignore attribute and will be ignored: + +```ts ignore +const value: Invalid = "ignored"; +``` + +The following example will trigger the type-checker to fail: + +```ts +const a: string = 42; +``` diff --git a/cli/tests/testdata/test/markdown_windows.out b/cli/tests/testdata/test/markdown_windows.out new file mode 100644 index 000000000..4810e50cd --- /dev/null +++ b/cli/tests/testdata/test/markdown_windows.out @@ -0,0 +1,7 @@ +Check [WILDCARD]/test/markdown_windows.md$11-14.js +Check [WILDCARD]/test/markdown_windows.md$17-20.ts +Check [WILDCARD]/test/markdown_windows.md$29-32.ts +error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. +const a: string = 42; + ^ + at [WILDCARD]/test/markdown_windows.md$29-32.ts:1:7 |
