# @splash-plus/jest-config

> Splash config for default jest commands

Latest version **2.0.3** (published 2020-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @splash-plus/jest-config
pnpm add @splash-plus/jest-config
yarn add @splash-plus/jest-config
bun add @splash-plus/jest-config
```

## 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 | 2.0.3 |
| Published | 2020-05-19 |
| First published | 2020-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.12.0 |
| Dependencies | 1 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Brook Pieretti |
| Maintainers | bmpieretti |
| Keywords | splash, splash-scripts, scripts, jest, config, scaffold |

## Links

- npm: https://www.npmjs.com/package/@splash-plus/jest-config
- Repository: https://github.com/bmpieretti/splash-scripts-jest-config
- Homepage: https://github.com/bmpieretti/splash-scripts-jest-config#readme
- Issues: https://github.com/bmpieretti/splash-scripts-jest-config/issues
- npm.io page: https://npm.io/package/@splash-plus/jest-config

## Dependencies (1)

- [chance](https://npm.io/package/chance.md) ^1.1.4

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2020-05-19
- 1.0.5 — 2020-04-30
- 0.0.0-development — 2020-04-30
- 1.0.3 — 2020-02-23

## README

<!-- ⚠️ This README has been generated from the file(s) "./readme/blueprint.md" ⚠️-->
[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/water.png)](#-pkgname-)

# @splash-plus/jest-config
[![CircleCI](https://circleci.com/gh/bmpieretti/splash-scripts-jest-config.svg?style=svg)](https://circleci.com/gh/bmpieretti/splash-scripts-jest-config)

<br />
Splash config for default jest commands

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/water.png)](#table-of-contents)

## Table of Contents

* [@splash-plus/jest-config](#splash-plusjest-config)
	* [Installing](#installing)
	* [Usage](#usage)
		* [API](#api)
			* [test](#test)
			* [test:watch](#testwatch)
			* [test:coverage](#testcoverage)
		* [Chance Instance](#chance-instance)
	* [Developing](#developing)
		* [Built With](#built-with)
		* [Prerequisites](#prerequisites)
		* [Building](#building)
		* [Setting up Dev](#setting-up-dev)
		* [Deploying / Publishing](#deploying--publishing)
		* [Commiting](#commiting)
	* [Versioning](#versioning)
	* [Licensing](#licensing)

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/water.png)](#installing)

## Installing

To install this library, install it from npm as a development dependency by running the command below:

```shell
npm i --save-dev @splash-plus/jest-config
```


[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/water.png)](#usage)

## Usage

To run this module, import the module into a project using [splash-scripts](https://github.com/bmpieretti/splash-scripts), and extend it from the extends field inside a splash config file:

``` js
// splash.config.js
{
  extends: ['@splash-plus/jest-config'],
  ...
}
```

### API

#### test
```
splash-scripts test
```

Runs all tests withing the current directory using the config defined in this package.

**Note** All commands support additional passed in arguments via simply appending them to the splash-scripts call: `splash-scripts [command] [...options]`

#### test:watch
```
splash-scripts test:watch
```

Runs all tests withing the current directory using the config defined in this package in watch mode.

#### test:coverage
```
splash-scripts test:coverage
```

Runs all tests in code coverage mode.

### Chance Instance
This module also exports a seeded [ChanceJS](https://chancejs.com/) instance you can leverage in your tests by simply requiring it from this module:
```js
import { chance } from '@splash-plus/jest-config';

chance.sentence();
```

This allows you to seed any randomness needed in tests to get consistent behavior in the event of a flaky test run. This module will log the current seed before jest runs any test, and in order to use a seed, provide it via an env to the script such as the below example:
```
export SEED=123456789
```


[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/water.png)](#developing)

## Developing

### Built With

- [Splash Scripts](https://github.com/bmpieretti/splash-scripts)
- [Jest](https://jestjs.io/)

### Prerequisites

To get started, simply clone the repo and install node deps
```shell
npm install
```

### Building

In order to test this package locally for development purposes, it's best to clone this locally and either npm link this package or modify the package.json install path to point to your local instance in a package that can consume these modules.

### Setting up Dev

Once the package path has been updated or linked, add an npm script to run the related command:

```json
// package.json
{
  ...,
  "scripts": {
    "test": "splash-scripts test"
  },
  ...
}
```

With that, simply run `npm run test` and jest will run the related tests using a local version of the splash-scripts-jest-config pacakge.

### Deploying / Publishing

Changes are automatically published upon merging to the master branch via [semantic release](https://github.com/semantic-release/semantic-release)

### Commiting

Commits utilize [cz-conventional-changelog](https://github.com/commitizen/cz-conventional-changelog) to force commit history to follow [conventional commits](https://www.conventionalcommits.org).

Once files are staged, simply run `git commit` and husky will automatically run verify before running conventional commits to assist in formatting semantic commits.


[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/water.png)](#versioning)

## Versioning

Using [SemVer](http://semver.org/) for versioning. For the versions available, see the release [tags](https://github.com/bmpieretti/splash-scripts-jest-config/tags).


[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/water.png)](#licensing)

## Licensing

Licensed under [MIT](https://opensource.org/licenses/MIT).

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