@istanbuljs/nyc-config-typescript
nyc configuration that works with typescript
Last updated 10 months ago by coreyfarrell .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @istanbuljs/nyc-config-typescript 
SYNC missed versions from official npm registry.

nyc-config-typescript

Handy default configuration for instrumenting your TypeScript-backed project with test coverage using nyc.

First install the dependencies:

npm i -D nyc source-map-support ts-node @istanbuljs/nyc-config-typescript

Your tsconfig.json must be configured to produce source maps, either inline or as sibling files.

.nycrc

And write a .nycrc that looks like this:

{
    "extends": "@istanbuljs/nyc-config-typescript",
    // OPTIONAL if you want coverage reported on every file, including those that aren't tested:
    "all": true
}

This package specifies the cache, exclude, and extension options for you - only override those if you absolutely must.

Running Tests

If you're using mocha:

test/mocha.opts

--require ts-node/register #replace with ts-node/register/transpile-only if you have custom types
--require source-map-support/register
--recursive
<glob for your test files>

Now setup the test scripts in your package.json like so (with the equivalent for your test runner):

{
    "test": "tsc && nyc mocha"
}

License

ISC

Current Tags

  • 1.0.1                                ...           latest (10 months ago)

9 Versions

  • 1.0.1                                ...           10 months ago
  • 1.0.0                                ...           10 months ago
  • 1.0.0-alpha.2                                ...           10 months ago
  • 1.0.0-alpha.1                                ...           a year ago
  • 1.0.0-alpha.0                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago

Copyright 2014 - 2017 © taobao.org |