diff options
author | Yusuke Tanaka <yusuktan@maguro.dev> | 2024-11-14 14:04:32 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-13 21:04:32 -0800 |
commit | 15fae197482a9ac84e0227200ef8f4d0d4e4bd33 (patch) | |
tree | be0cce33690ed742d950091bdb46c22ce04b0a1f /tests/specs/test/markdown_ts_expect_error/main.md | |
parent | 6b5cb41545086a7a550c698620f5b7bb19b5524f (diff) |
fix(cli): preserve comments in doc tests (#26828)
This commit makes comments in code snippets in JSDoc or markdown
preserved when they are executed as tests. In particular, this is needed
to get TypeScript special comments such as `@ts-ignore` or
`@ts-expect-error` to work correctly.
Fixes #26728
Diffstat (limited to 'tests/specs/test/markdown_ts_expect_error/main.md')
-rw-r--r-- | tests/specs/test/markdown_ts_expect_error/main.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/specs/test/markdown_ts_expect_error/main.md b/tests/specs/test/markdown_ts_expect_error/main.md new file mode 100644 index 000000000..9be70e919 --- /dev/null +++ b/tests/specs/test/markdown_ts_expect_error/main.md @@ -0,0 +1,8 @@ +# Documentation + +This test case checks if `@ts-expect-error` comment works as expected. + +```ts +// @ts-expect-error +const a: string = 42; +``` |