# @istanbuljs/nyc-config-typescript

> nyc configuration that works with typescript

Latest version **1.0.2** (published 2021-12-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install @istanbuljs/nyc-config-typescript
pnpm add @istanbuljs/nyc-config-typescript
yarn add @istanbuljs/nyc-config-typescript
bun add @istanbuljs/nyc-config-typescript
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-12-01 |
| First published | 2019-01-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1103 |
| Author | Jason Kurian |
| Maintainers | coreyfarrell, bcoe, jakxz, gotwarlost, oss-bot |
| Keywords | typescript, config, nyc, test, coverage |

## Links

- npm: https://www.npmjs.com/package/@istanbuljs/nyc-config-typescript
- Repository: https://github.com/istanbuljs/istanbuljs
- Homepage: https://istanbul.js.org/
- Issues: https://github.com/istanbuljs/istanbuljs/issues
- npm.io page: https://npm.io/package/@istanbuljs/nyc-config-typescript

## Dependencies (1)

- [@istanbuljs/schema](https://npm.io/package/@istanbuljs/schema.md) ^0.1.2

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-12-01
- 1.0.1 — 2019-12-30
- 1.0.0 — 2019-12-20
- 1.0.0-alpha.2 — 2019-12-07
- 1.0.0-alpha.1 — 2019-10-06
- 1.0.0-alpha.0 — 2019-06-19
- 0.1.3 — 2019-05-02
- 0.1.2 — 2019-04-24
- 0.1.1 — 2019-03-12
- 0.1.0 — 2019-01-29

## README

# nyc-config-typescript

Handy default configuration for instrumenting your TypeScript-backed
project with test coverage using [nyc](https://github.com/istanbuljs/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:

```js
{
    "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.
If you are going to modify `include` or `exclude` and you have specified a separate `outDir` in `tsconfig.json`, make sure that it remains included so that source mapping is possible. 

## Running Tests

### If you're using `mocha`

In `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):

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

### If you're using Jasmine
In `package.json`:

```json
{
    "test": "tsc && nyc --require ts-node/register jasmine"
}
```

## License

ISC

---
_Source: https://npm.io/package/@istanbuljs/nyc-config-typescript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
