diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/test_tests.rs | 6 | ||||
-rw-r--r-- | cli/tests/testdata/test/doc_only.out | 5 | ||||
-rw-r--r-- | cli/tests/testdata/test/doc_only/mod.ts | 10 |
3 files changed, 21 insertions, 0 deletions
diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs index 971e756a9..d9d1eed45 100644 --- a/cli/tests/integration/test_tests.rs +++ b/cli/tests/integration/test_tests.rs @@ -67,6 +67,12 @@ itest!(doc { output: "test/doc.out", }); +itest!(doc_only { + args: "test --doc --allow-all test/doc_only", + exit_code: 0, + output: "test/doc_only.out", +}); + itest!(markdown { args: "test --doc --allow-all test/markdown.md", exit_code: 1, diff --git a/cli/tests/testdata/test/doc_only.out b/cli/tests/testdata/test/doc_only.out new file mode 100644 index 000000000..c2a91cae7 --- /dev/null +++ b/cli/tests/testdata/test/doc_only.out @@ -0,0 +1,5 @@ +Check [WILDCARD]/test/doc_only/mod.ts$2-5.ts +running 0 tests from [WILDCARD]/test/doc_only/mod.ts + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) + diff --git a/cli/tests/testdata/test/doc_only/mod.ts b/cli/tests/testdata/test/doc_only/mod.ts new file mode 100644 index 000000000..467d850a2 --- /dev/null +++ b/cli/tests/testdata/test/doc_only/mod.ts @@ -0,0 +1,10 @@ +/** + * ```ts + * import "./mod.ts"; + * ``` + */ +Deno.test("unreachable", function () { + throw new Error( + "modules that don't end with _test are scanned for documentation tests only should not be executed", + ); +}); |