https://github.com/uki00a/deno-power-doctest
https://github.com/uki00a/deno-power-doctest
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/uki00a/deno-power-doctest
- Owner: uki00a
- License: mit
- Created: 2023-08-29T00:58:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-19T10:40:57.000Z (over 2 years ago)
- Last Synced: 2025-07-09T07:08:38.017Z (9 months ago)
- Language: TypeScript
- Homepage: https://deno.land/x/deno_power_doctest
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deno-power-doctest
Deno port of [power-doctest](https://github.com/azu/power-doctest).
## Examples
```typescript
const n: number = 123;
console.log(n); // => 123
console.log(n + 1); // => 124
console.log("foo"); // => "foo"
console.log({ n: 1, s: "bar" }); // => { n: 1, s: "bar" }
```
```typescript
import { test } from "https://deno.land/x/deno_power_doctest@$MODULE_VERSION/mod.ts";
Deno.test({
name: "test",
fn: async (t) => {
await test(t, "README.md");
},
permissions: {
read: ["."],
write: [".doctest.ts"],
},
});
```
## Prior works
- [power-doctest](https://github.com/azu/power-doctest)
- [rust-skeptic](https://github.com/budziq/rust-skeptic)
- [doctest](https://docs.python.org/3/library/doctest.html)
- [Godoc examples](https://go.dev/blog/examples)