diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-07-27 01:48:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-26 19:48:35 +0200 |
commit | 2e69d2135a945682bc67b058a29b221e55915ffb (patch) | |
tree | ed952944acd36502d6c94ba0e87d698bab523de7 /cli/tests | |
parent | dfba7a2b0197b05b3cb61724096111cc618aa747 (diff) |
feat(cli/tools/test): imply media type from doc attribute (#11438)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/test/doc.out | 13 | ||||
-rw-r--r-- | cli/tests/test/doc.ts | 36 |
2 files changed, 41 insertions, 8 deletions
diff --git a/cli/tests/test/doc.out b/cli/tests/test/doc.out index 18f81d3a3..91ecbd4d4 100644 --- a/cli/tests/test/doc.out +++ b/cli/tests/test/doc.out @@ -1,5 +1,10 @@ -Check [WILDCARD]/doc.ts$2-7 +Check [WILDCARD]/doc.ts$2-5.ts +Check [WILDCARD]/doc.ts$6-9.js +Check [WILDCARD]/doc.ts$10-13.jsx +Check [WILDCARD]/doc.ts$14-17.ts +Check [WILDCARD]/doc.ts$18-21.tsx +Check [WILDCARD]/doc.ts$30-35.ts error: TS2367 [ERROR]: This condition will always return 'false' since the types 'string' and 'number' have no overlap. -console.assert(example() == 42); - ~~~~~~~~~~~~~~~ - at [WILDCARD]/doc.ts$2-7.ts:3:16 +console.assert(check() == 42); + ~~~~~~~~~~~~~ + at [WILDCARD]/doc.ts$30-35.ts:3:16 diff --git a/cli/tests/test/doc.ts b/cli/tests/test/doc.ts index 9298393eb..52fe6bdf0 100644 --- a/cli/tests/test/doc.ts +++ b/cli/tests/test/doc.ts @@ -1,10 +1,38 @@ /** * ``` - * import { example } from "./doc.ts"; + * import * as doc from "./doc.ts"; + * ``` + * + * ```js + * import * as doc from "./doc.ts"; + * ``` + * + * ```jsx + * import * as doc from "./doc.ts"; + * ``` + * + * ```ts + * import * as doc from "./doc.ts"; + * ``` + * + * ```tsx + * import * as doc from "./doc.ts"; + * ``` + * + * ```text + * import * as doc from "./doc.ts"; + * ``` + * + * @module doc + */ + +/** + * ``` + * import { check } from "./doc.ts"; * - * console.assert(example() == 42); + * console.assert(check() == 42); * ``` */ -export function example(): string { - return "example"; +export function check(): string { + return "check"; } |