0.13.0 • Published 2 years ago

@spec-validator/doc-tester v0.13.0

Weekly downloads
174
License
Apache-2.0
Repository
github
Last release
2 years ago

@spec-validator/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.13.0

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.6.1

3 years ago

0.5.0

3 years ago

0.4.8

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.2.19

3 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.2.16

3 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago