https://github.com/wldcordeiro/jest-runner-write-prettier
A Jest Runner for Prettier that writes the changes
https://github.com/wldcordeiro/jest-runner-write-prettier
javascript jest testing
Last synced: 3 months ago
JSON representation
A Jest Runner for Prettier that writes the changes
- Host: GitHub
- URL: https://github.com/wldcordeiro/jest-runner-write-prettier
- Owner: wldcordeiro
- Created: 2018-05-16T21:25:57.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-17T07:45:09.000Z (about 8 years ago)
- Last Synced: 2025-07-01T08:42:55.717Z (about 1 year ago)
- Topics: javascript, jest, testing
- Language: JavaScript
- Size: 116 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jest-runner-write-prettier
## Usage
### Install
Install `jest`_(it needs Jest 21+)_ and `jest-runner-write-prettier`
```bash
yarn add --dev jest jest-runner-write-prettier
# or with NPM
npm install --save-dev jest jest-runner-write-prettier
```
### Add it to your Jest config
In your `package.json`
```json
{
"jest": {
"runner": "jest-runner-write-prettier",
"moduleFileExtensions": [
"js",
"jsx",
"json",
"ts",
"tsx",
"css",
"less",
"scss",
"graphql",
"md",
"markdown"
],
"testMatch": [
"**/*.js",
"**/*.jsx",
"**/*.json",
"**/*.ts",
"**/*.tsx",
"**/*.css",
"**/*.less",
"**/*.scss",
"**/*.graphql",
"**/*.md",
"**/*.markdown"
]
}
}
```
Or in `jest.config.js`
```js
module.exports = {
runner: 'jest-runner-write-prettier',
moduleFileExtensions: [
'js',
'jsx',
'json',
'ts',
'tsx',
'css',
'less',
'scss',
'graphql',
'md',
'markdown'
],
testMatch: [
'**/*.js',
'**/*.jsx',
'**/*.json',
'**/*.ts',
'**/*.tsx',
'**/*.css',
'**/*.less',
'**/*.scss',
'**/*.graphql',
'**/*.md',
'**/*.markdown'
]
}
```
### Run Jest
```bash
yarn jest
```