# @autosoft/jest-preset

> A base to easily run Jest with SWC.

Latest version **1.0.5** (published 2023-01-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @autosoft/jest-preset
pnpm add @autosoft/jest-preset
yarn add @autosoft/jest-preset
bun add @autosoft/jest-preset
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-01-07 |
| First published | 2023-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Connor White |
| Maintainers | bconnorwhite |
| Keywords | jest, preset, testing, test, unit, auto, autosoft, autorepo, swc, config |

## Links

- npm: https://www.npmjs.com/package/@autosoft/jest-preset
- Repository: https://github.com/autosoftoss/jest-preset
- npm.io page: https://npm.io/package/@autosoft/jest-preset

## Dependencies (3)

- [jest](https://npm.io/package/jest.md) ^29.3.1
- [@swc/core](https://npm.io/package/@swc/core.md) ^1.3.24
- [@swc/jest](https://npm.io/package/@swc/jest.md) ^0.2.24

## Recent versions

- 1.0.5 (latest) — 2023-01-07
- 1.0.4 — 2023-01-06
- 1.0.3 — 2023-01-06
- 1.0.2 — 2023-01-05
- 1.0.1 — 2023-01-02
- 1.0.0 — 2023-01-02

## README

<!--BEGIN HEADER-->
<div id="top" align="center">
  <h1>@autosoft/jest-preset</h1>
  <a href="https://npmjs.com/package/@autosoft/jest-preset">
    <img alt="npm" src="https://img.shields.io/npm/v/@autosoft/jest-preset.svg">
  </a>
  <a href="https://github.com/autosoftoss/jest-preset">
    <img alt="typescript" src="https://img.shields.io/github/languages/top/autosoftoss/jest-preset.svg">
  </a>
</div>

<br />

<blockquote align="center">A base to easily run Jest with SWC.</blockquote>

<br />

_If I should maintain this repo, please ⭐️_
<a href="https://github.com/autosoftoss/jest-preset">
  <img align="right" alt="GitHub stars" src="https://img.shields.io/github/stars/autosoftoss/jest-preset?label=%E2%AD%90%EF%B8%8F&style=social">
</a>

_DM me on [Twitter](https://twitter.com/bconnorwhite) if you have questions or suggestions._
<a href="https://twitter.com/bconnorwhite">
  <img align="right" alt="Twitter Follow" src="https://img.shields.io/twitter/url?label=%40bconnorwhite&style=social&url=https%3A%2F%2Ftwitter.com%2Fbconnorwhite">
</a>

---
<!--END HEADER-->

This package bundles [Jest](https://jestjs.io/) and [SWC](https://swc.rs/) together, providing an fast and easy way to run tests.

It comes preconfigured to work with TypeScript and ESM.

## Installation

```sh
yarn add --dev @autosoft/jest-preset
```

```sh
npm install --save-dev @autosoft/jest-preset
```

```sh
pnpm add --save-dev @autosoft/jest-preset
```

## Usage

In your `package.json` file:

```json
{
  "jest": {
    "preset": "@autosoft/jest-preset"
  }
}
```

### Jest

Now to run jest, run `yarn jest` or `npm run jest`.

## Jest Preset

All tests will need to be in the `test` directory and end with `.test.ts`. Additionally, coverage will be collected from all files in the `source` directory.

```json
{
  "collectCoverage": true,
  "collectCoverageFrom": [
    "source/**/*.ts"
  ],
  "coverageProvider": "v8",
  "coverageReporters": [
    "text"
  ],
  "extensionsToTreatAsESM": [
    ".ts",
    ".tsx"
  ],
  "moduleNameMapper": {
    "^#(.*)": "$1",
    "^(\\.{1,2}/.*)\\.js$": "$1"
  },
  "testRegex": "test/(.*).test.ts$",
  "transform": {
    "^.+\\.tsx?$": [
      "@swc/jest", {
        "jsc": {
          "target": "es2019"
        }
      }
    ]
  }
}
```

<!--BEGIN FOOTER-->

<br />

<h2 id="dependencies">Dependencies<a href="https://www.npmjs.com/package/@autosoft/jest-preset?activeTab=dependencies"><img align="right" alt="dependencies" src="https://img.shields.io/librariesio/release/npm/@autosoft/jest-preset.svg"></a></h2>

- [@swc/core](https://www.npmjs.com/package/@swc/core): Super-fast alternative for babel
- [@swc/jest](https://www.npmjs.com/package/@swc/jest): swc integration for jest
- [jest](https://www.npmjs.com/package/jest): Delightful JavaScript Testing.

<br />

<h3>Dev Dependencies</h3>

- [jsonlint](https://www.npmjs.com/package/jsonlint): Validate JSON

<br />

<h2 id="license">License <a href="https://opensource.org/licenses/MIT"><img align="right" alt="license" src="https://img.shields.io/npm/l/@autosoft/jest-preset.svg"></a></h2>

[MIT](https://opensource.org/licenses/MIT) - _The MIT License_
<!--END FOOTER-->

---
_Source: https://npm.io/package/@autosoft/jest-preset · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
