diff options
Diffstat (limited to 'tests/specs/test')
-rw-r--r-- | tests/specs/test/doc_ts_expect_error/__test__.jsonc | 5 | ||||
-rw-r--r-- | tests/specs/test/doc_ts_expect_error/mod.out | 8 | ||||
-rw-r--r-- | tests/specs/test/doc_ts_expect_error/mod.ts | 13 | ||||
-rw-r--r-- | tests/specs/test/document/__test__.jsonc | 9 | ||||
-rw-r--r-- | tests/specs/test/document/document_test.js | 3 | ||||
-rw-r--r-- | tests/specs/test/document/document_test.out | 22 | ||||
-rw-r--r-- | tests/specs/test/markdown_ts_expect_error/__test__.jsonc | 5 | ||||
-rw-r--r-- | tests/specs/test/markdown_ts_expect_error/main.md | 8 | ||||
-rw-r--r-- | tests/specs/test/markdown_ts_expect_error/main.out | 6 | ||||
-rw-r--r-- | tests/specs/test/package_json_basic/install.out | 2 | ||||
-rw-r--r-- | tests/specs/test/package_json_basic_auto_install/test.out | 2 |
11 files changed, 81 insertions, 2 deletions
diff --git a/tests/specs/test/doc_ts_expect_error/__test__.jsonc b/tests/specs/test/doc_ts_expect_error/__test__.jsonc new file mode 100644 index 000000000..ba64887a3 --- /dev/null +++ b/tests/specs/test/doc_ts_expect_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "test --doc mod.ts", + "exitCode": 0, + "output": "mod.out" +} diff --git a/tests/specs/test/doc_ts_expect_error/mod.out b/tests/specs/test/doc_ts_expect_error/mod.out new file mode 100644 index 000000000..d464d13d7 --- /dev/null +++ b/tests/specs/test/doc_ts_expect_error/mod.out @@ -0,0 +1,8 @@ +Check [WILDCARD]/mod.ts +Check [WILDCARD]/mod.ts$2-10.ts +running 0 tests from ./mod.ts +running 1 test from ./mod.ts$2-10.ts +[WILDCARD]/mod.ts$2-10.ts ... ok ([WILDCARD]ms) + +ok | 1 passed | 0 failed ([WILDCARD]ms) + diff --git a/tests/specs/test/doc_ts_expect_error/mod.ts b/tests/specs/test/doc_ts_expect_error/mod.ts new file mode 100644 index 000000000..eeace602a --- /dev/null +++ b/tests/specs/test/doc_ts_expect_error/mod.ts @@ -0,0 +1,13 @@ +/** + * ```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; +} diff --git a/tests/specs/test/document/__test__.jsonc b/tests/specs/test/document/__test__.jsonc new file mode 100644 index 000000000..cf73b4bab --- /dev/null +++ b/tests/specs/test/document/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "tests": { + "document": { + "args": "test document_test.js", + "exitCode": 1, + "output": "document_test.out" + } + } +} diff --git a/tests/specs/test/document/document_test.js b/tests/specs/test/document/document_test.js new file mode 100644 index 000000000..d60d6893c --- /dev/null +++ b/tests/specs/test/document/document_test.js @@ -0,0 +1,3 @@ +Deno.test("document query selector", () => { + document.querySelector("div"); +}); diff --git a/tests/specs/test/document/document_test.out b/tests/specs/test/document/document_test.out new file mode 100644 index 000000000..342cee0e4 --- /dev/null +++ b/tests/specs/test/document/document_test.out @@ -0,0 +1,22 @@ +running 1 test from ./document_test.js +document query selector ... FAILED [WILDCARD] + + ERRORS + +document query selector => ./document_test.js:1:6 +error: ReferenceError: document is not defined + document.querySelector("div"); + ^ + at [WILDCARD]document_test.js:2:3 + + info: document global is not available in Deno. + hint: Use a library like happy-dom, deno_dom, linkedom or JSDom + and setup the document global according to the library documentation. + + FAILURES + +document query selector => ./document_test.js:1:6 + +FAILED | 0 passed | 1 failed ([WILDCARD]) + +error: Test failed diff --git a/tests/specs/test/markdown_ts_expect_error/__test__.jsonc b/tests/specs/test/markdown_ts_expect_error/__test__.jsonc new file mode 100644 index 000000000..ad73f6df6 --- /dev/null +++ b/tests/specs/test/markdown_ts_expect_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "test --doc main.md", + "exitCode": 0, + "output": "main.out" +} 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; +``` diff --git a/tests/specs/test/markdown_ts_expect_error/main.out b/tests/specs/test/markdown_ts_expect_error/main.out new file mode 100644 index 000000000..65990cd3f --- /dev/null +++ b/tests/specs/test/markdown_ts_expect_error/main.out @@ -0,0 +1,6 @@ +Check [WILDCARD]/main.md$5-9.ts +running 1 test from ./main.md$5-9.ts +[WILDCARD]/main.md$5-9.ts ... ok ([WILDCARD]ms) + +ok | 1 passed | 0 failed ([WILDCARD]ms) + diff --git a/tests/specs/test/package_json_basic/install.out b/tests/specs/test/package_json_basic/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/test/package_json_basic/install.out +++ b/tests/specs/test/package_json_basic/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/test/package_json_basic_auto_install/test.out b/tests/specs/test/package_json_basic_auto_install/test.out index 2f109ef38..749c39548 100644 --- a/tests/specs/test/package_json_basic_auto_install/test.out +++ b/tests/specs/test/package_json_basic_auto_install/test.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Check file://[WILDCARD]/lib.test.ts |