diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-08-14 18:33:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-14 12:33:58 +0200 |
commit | f90231924d96130ec80b31e3589253a15e250896 (patch) | |
tree | dad74b1a8b9112ba6d55ae4fe6b3a3d7b2257a5e /cli/tests | |
parent | 1d1507384bca78027c9003b81465bd99a585cace (diff) |
fix(cli): explicitly scan for ignore attribute in inline tests (#11647)
This commits adds "ignore" as a known attribute for Markdown
codeblock which drops a code block early whenever it is seen
in documentation tests.
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/testdata/test/markdown.md | 6 | ||||
-rw-r--r-- | cli/tests/testdata/test/markdown.out | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/cli/tests/testdata/test/markdown.md b/cli/tests/testdata/test/markdown.md index e5afb841b..d18dbd108 100644 --- a/cli/tests/testdata/test/markdown.md +++ b/cli/tests/testdata/test/markdown.md @@ -18,6 +18,12 @@ The following block should be given a ts extension on extraction: 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 diff --git a/cli/tests/testdata/test/markdown.out b/cli/tests/testdata/test/markdown.out index 3f7bc7366..38c9f0349 100644 --- a/cli/tests/testdata/test/markdown.out +++ b/cli/tests/testdata/test/markdown.out @@ -1,7 +1,7 @@ Check [WILDCARD]/test/markdown.md$11-14.js Check [WILDCARD]/test/markdown.md$17-20.ts -Check [WILDCARD]/test/markdown.md$23-26.ts +Check [WILDCARD]/test/markdown.md$29-32.ts error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. const a: string = 42; ^ - at [WILDCARD]/test/markdown.md$23-26.ts:1:7 + at [WILDCARD]/test/markdown.md$29-32.ts:1:7 |