Deno-first types testing tools
tytest
lets you write tests for your type definitions by creating files with
the *_test.ts
extension.
This project was strongly influenced by tsd, and our current goal is to port tsd to Deno.
Type assertions are strict. This means that if you expect the type to be ""
but the argument is of type string
, the tests will fail.
import { expectType } from "https://deno.land/x/tytest@$VERSION/mod.ts";
expectType<string>("");
then,
deno run --unstable --allow-read --allow-write --allow-net https://deno.land/x/tytest@$VERSION/cli.ts
The custom module resolver is not implemented, so it does not work correctly for remote modules. This is a priority issue.
For example, the following module will be processed as any
.
import { join } from "https://deno.land/[email protected]/path/mod.ts";
import { expectType } from "https://deno.land/x/tytest@$VERSION/mod.ts";
expectType<string>(join(""));
Copyright © 2021-present TomokiMiyauci.
Released under the MIT license