Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

typescript-doctest

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-doctest

Doc Test Generator for TypeScript Projects

latest
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

Doc Tests for TypeScript Projects

typescript-doctest provides a CLI to generate doc tests from your TypeScript documentation.

Installation

npm install -g typescript-doctest

Features

  • Generates tests for all codeblocks in your docs that start with typescript doctest
  • Also generates tests for these kind of codeblocks in your README.md
  • Supports import statements and import(...) call resolution from within the doc tests by using the TypeScript Compiler; respecting any custom baseUrl or paths setup
  • Allows to hide certain lines from your doc tests in the documentation generated by typedoc by prefixing them with #

Note: You need to install typescript-doctest as a dev-dependency in your project for the typeoc integration to work.

Example

See the included example project for a basic setup.

Usage

  • Set the language of your documentation codeblocks to typescript doctest
  • Run ts-doctest PROJECT_DIR TEST_DIR
  • Invoke your test runner

License

Licensed under either of

Keywords

tests

FAQs

Package last updated on 04 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts