mirror of
https://github.com/denoland/deno.git
synced 2025-02-10 16:12:26 -05:00
![Yusuke Tanaka](/assets/img/avatar_default.png)
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
13 lines
222 B
TypeScript
13 lines
222 B
TypeScript
/**
|
|
* ```ts
|
|
* import { add } from "./mod.ts";
|
|
*
|
|
* add(1, 2);
|
|
*
|
|
* // @ts-expect-error: can only add numbers
|
|
* add('1', '2');
|
|
* ```
|
|
*/
|
|
export function add(first: number, second: number) {
|
|
return first + second;
|
|
}
|