You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 jaren geleden
1234567891011121314151617181920212223242526272829303132333435
  1. # babel-preset-jest
  2. > Babel preset for all Jest plugins. This preset is automatically included when using [babel-jest](https://github.com/facebook/jest/tree/master/packages/babel-jest).
  3. ## Install
  4. ```sh
  5. $ npm install --save-dev babel-preset-jest
  6. ```
  7. ## Usage
  8. ### Via `.babelrc` (Recommended)
  9. **.babelrc**
  10. ```json
  11. {
  12. "presets": ["jest"]
  13. }
  14. ```
  15. ### Via CLI
  16. ```sh
  17. $ babel script.js --presets jest
  18. ```
  19. ### Via Node API
  20. ```javascript
  21. require('babel-core').transform('code', {
  22. presets: ['jest'],
  23. });
  24. ```