|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
518 bytes
|
| Line | |
|---|
| 1 | # babel-preset-jest
|
|---|
| 2 |
|
|---|
| 3 | > Babel preset for all Jest plugins. This preset is automatically included when using [babel-jest](https://github.com/facebook/jest/tree/main/packages/babel-jest).
|
|---|
| 4 |
|
|---|
| 5 | ## Install
|
|---|
| 6 |
|
|---|
| 7 | ```sh
|
|---|
| 8 | $ npm install --save-dev babel-preset-jest
|
|---|
| 9 | ```
|
|---|
| 10 |
|
|---|
| 11 | ## Usage
|
|---|
| 12 |
|
|---|
| 13 | ### Via `babel.config.js` (Recommended)
|
|---|
| 14 |
|
|---|
| 15 | ```js
|
|---|
| 16 | module.exports = {
|
|---|
| 17 | presets: ['jest'],
|
|---|
| 18 | };
|
|---|
| 19 | ```
|
|---|
| 20 |
|
|---|
| 21 | ### Via CLI
|
|---|
| 22 |
|
|---|
| 23 | ```sh
|
|---|
| 24 | $ babel script.js --presets jest
|
|---|
| 25 | ```
|
|---|
| 26 |
|
|---|
| 27 | ### Via Node API
|
|---|
| 28 |
|
|---|
| 29 | ```javascript
|
|---|
| 30 | require('@babel/core').transform('code', {
|
|---|
| 31 | presets: ['jest'],
|
|---|
| 32 | });
|
|---|
| 33 | ```
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.