Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9
Jest preset for testing Preact apps
License
NotificationsYou must be signed in to change notification settings
preactjs/jest-preset-preact
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Jest preset containing all required configuration for writing tests forpreact.
Features:
- Transpiles JSX to
h() - Aliases for
reactimports to point topreact/compat - Automatically serialize Preact
VNodesin snapshots - Stub style imports (
.css,.less,.sass/scss, etc) - Add typeahead preview for filtering in jest's watch mode
Install it via npm or yarn:
npm install --save-dev jest-preset-preact# or via yarnyarn add -D jest-preset-preact...and add the preset to yourjest.config.js file.
// jest.config.jsmodule.exports={preset:'jest-preset-preact',};
You can override the default Babel config by providing your own Babel config file:
// babel.config.jsmodule.exports={env:{test:{plugins:[["@babel/plugin-transform-react-jsx",{runtime:"automatic",importSource:"preact"}]]}}}
This, for example, would enable the runtime JSX transform instead of the classic.
MIT, seethe LICENSE file.
About
Jest preset for testing Preact apps
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors7
Uh oh!
There was an error while loading.Please reload this page.