0.15.2 • Published 11 months ago

@brokkr/doc-tester v0.15.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 months ago

@brokkr/doc-tester

Internally extracts typescript code from 'ts/typescript' code blocks and feeds those to ts-node. Line mapping is done accordingly to indicate the locations of the errors within the source Markdown files.

Run

ỳarn test-docs

Expected Markdown format

To denote a code block just write:

`ts

const foo = 'On a separate line'

`

The blocks can be additionally labeled to avoid definition collisions:

`ts label-one

const foo = 'One'

`

`ts label-two

const foo = 'Another'

`

`ts label-three

const foo = 'Yet Another'

`

this notifies the tool that definition scopes should be different thus const collision will not takes place.

In case if the block should not be executed - mark it with a label starting with # (useful if execution will yield side-effects).

`ts #ignore

server.serve()

`

Known limitiations

  1. By design ignores any non typescript blocks.
  2. By design ignores any non-multiline blocks (i.e. triple quotes must live on their own lines).
  3. Works only with triple quote blocks. <code> blocks are ignored.
  4. Does not affest Jest's code coverage in any way
0.15.2

11 months ago

0.15.1

11 months ago

0.15.0

11 months ago