- Notifications
You must be signed in to change notification settings - Fork5
✨ An opinionated Jest preset for React modules
License
americanexpress/amex-jest-preset-react
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
An opinionatedJest preset for React modules. For non-React projects useamex-jest-preset
Want to get paid for your contributions to
amex-jest-preset-react
?Send your resume tooneamex.careers@aexp.com
- Base for Jest's configuration for React modules
Install:
npm install --save-dev amex-jest-preset-react
And in yourJest configuration:
{"preset":"amex-jest-preset-react"}
And... that's it! You now have all the boilerplate Jest configurations set up for you! Runningjest
from yournpm test
script will use all these configurations!
You can add on and/or override any values provided in this preset as you wish in yourJest configuration.
It should be noted that if overriding thesetupFilesAfterEnv
option you may want to extend off of thesetup file provided by amex-jest-preset-react in order to preserve that files' content. Otherwise you will lose anything we provide for you inthere. Do so as follows:
// in custom-jest-setup.jsrequire('amex-jest-preset-react/jest-setup');// your own custom setup
Extendsamex-jest-preset and adds the following configurations that are specific to testing React modules:
testEnvironment tells Jest to use
jsdom
test environment as it is often used while testing React components (amex-jest-preset setstestEnvironment
tonode
)moduleNameMapper tells Jest to treat CSS modules as identity objects
This package is compatible only with React 17+.
Any contributions made under this project will be governed by theApache License2.0.
This project adheres to theAmerican Express Community Guidelines.By participating, you are expected to honor these guidelines.
We welcome Your interest in the American Express Open Source Community on Github.Any Contributor to any Open Source Project managed by the American Express OpenSource Community must accept and sign an Agreement indicating agreement to theterms below. Except for the rights granted in this Agreement to American Expressand to recipients of software distributed by American Express, You reserve allright, title, and interest, if any, in and to Your Contributions. Pleasefillout the Agreement.
Please feel free to open pull requests and seeCONTRIBUTING.md to learn how to get started contributing.
About
✨ An opinionated Jest preset for React modules
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.