0.1.3 • Published 1 year ago

the-real-doctest v0.1.3

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
1 year ago

The Real Doctest

This library provides commands to execute TSDoc @example tags in Typescript.

We also have a Visual Studio Code extension that uses this library directly from the IDE:

Usage

npx the-real-doctest test src/lib/utils.ts

Expression statements with ==, !=, === or !== will be checked for equality

// src/lib/utils.ts

/**
 * @example f(0) == 10
 * @example f(0) != 10 // This should fail
 * @example f(10) == 20
 * @example f(20) != 20
 * @example f(20) == 20 // This should fail
 */
function f(x: number) {
  return x + 10
}

Output:

3 doctests succeeded
2 doctests failed
At src/lib/utils.ts:3
 >> 10 != 10
At src/lib/utils.ts:6
 >> 30 == 20

Help

npx the-real-doctest --help

Setup

Install the library as a dev dependency with the package manager of your choice

Then, run npx the-real-doctest install.

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.5

1 year ago

0.0.6

1 year ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago