All Projects → mzgoddard → Jest Webpack

mzgoddard / Jest Webpack

Use jest with webpack.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Jest Webpack

Craco Alias
A craco plugin for automatic aliases generation for Webpack and Jest
Stars: ✭ 56 (-37.08%)
Mutual labels:  webpack, jest
Starter Lapis
Cutting edge starter kit
Stars: ✭ 72 (-19.1%)
Mutual labels:  webpack, jest
Starter React Flux
Generate your React PWA project with TypeScript or JavaScript
Stars: ✭ 65 (-26.97%)
Mutual labels:  webpack, jest
React Boilerplate
Production-ready boilerplate for building universal web apps with React and Redux
Stars: ✭ 53 (-40.45%)
Mutual labels:  webpack, jest
React Boilerplate
This project is deprecated. Please use CRA instead.
Stars: ✭ 88 (-1.12%)
Mutual labels:  webpack, jest
Snackui
SnackUI 🍑 - the final React style library. With an *optimizing compiler* that lets you write views naturally, with easier DX, working on native and web at once, all while being faster than hand-rolling your own CSS.
Stars: ✭ 55 (-38.2%)
Mutual labels:  webpack, webpack-plugin
Wcer
Webpack plugin to enable reloading while developing Chrome extensions.
Stars: ✭ 71 (-20.22%)
Mutual labels:  webpack, webpack-plugin
Webpack Webextension Plugin
Webpack plugin that compiles WebExtension manifest.json files and adds smart auto reload
Stars: ✭ 47 (-47.19%)
Mutual labels:  webpack, webpack-plugin
Page Builder
自定义页面构建平台
Stars: ✭ 81 (-8.99%)
Mutual labels:  webpack, webpack-plugin
Alias Hq
The end-to-end solution for configuring, refactoring, maintaining and using path aliases
Stars: ✭ 77 (-13.48%)
Mutual labels:  webpack, jest
Js Toolbox
CLI tool to simplify the development of JavaScript apps/libraries with little to no configuration. (WORK IN PROGRESS/PACKAGE NOT PUBLISHED).
Stars: ✭ 53 (-40.45%)
Mutual labels:  webpack, jest
Add Asset Webpack Plugin
Dynamically add an asset to the Webpack graph
Stars: ✭ 84 (-5.62%)
Mutual labels:  webpack, webpack-plugin
Node Env Webpack Plugin
Simplified `NODE_ENV` handling with webpack
Stars: ✭ 51 (-42.7%)
Mutual labels:  webpack, webpack-plugin
Auxpack
A dashboard for monitoring Webpack build stats.
Stars: ✭ 86 (-3.37%)
Mutual labels:  webpack, webpack-plugin
Html Inline Css Webpack Plugin
☄️ A webpack plugin for convert external stylesheet to the embedded stylesheet
Stars: ✭ 48 (-46.07%)
Mutual labels:  webpack, webpack-plugin
Ifme
Free, open source mental health communication web app to share experiences with loved ones
Stars: ✭ 1,147 (+1188.76%)
Mutual labels:  webpack, jest
Webpack Aliyun Oss
一个webpack(version >= 4)插件,上传资源到阿里云oss。可以作为webpack插件使用,也可独立使用
Stars: ✭ 36 (-59.55%)
Mutual labels:  webpack, webpack-plugin
Dotenv Webpack
A secure webpack plugin that supports dotenv and other environment variables and only exposes what you choose and use.
Stars: ✭ 1,022 (+1048.31%)
Mutual labels:  webpack, webpack-plugin
Mostly
They mostly come at night; mostly.
Stars: ✭ 78 (-12.36%)
Mutual labels:  webpack, jest
Google Fonts Plugin
Webpack plugin that downloads fonts from Google Fonts and encodes them to base64
Stars: ✭ 83 (-6.74%)
Mutual labels:  webpack, webpack-plugin

jest-webpack

Build Status Build status

A helper tool and webpack plugin to integrate jest and webpack.

Add it to your project as a developer dependency. And run it like webpack or webpack-dev-server from the command line or as a package.json script.

Install

npm install --save-dev jest-webpack

or with yarn

yarn add -D jest-webpack

Update package.json

Add it as a package.json script

{
  "name": "my-package",
  "scripts": {
    "test": "jest-webpack"

Run it

npm test

Run it with jest options

npm test -- --testPathPattern test-just-this-file

Status

jest-webpack currently works with a lot of jest options out of the bag since there is no special handling needed and they can just be passed to jest by the tool. You can see what is so far specifically tested so far in https://github.com/mzgoddard/jest-webpack/issues/3.

How it works?

jest-webpack uses a webpack plugin to add related plugins that are responsible for 4 operations.

  1. The TestEntriesPlugin finds test files that jest will operate on and creates entry chunks for them.
  2. The EntryReferencePlugin creates additional entries for any other files that are depended on by those test files. These entries return objects pointing to the various transformations of that file. If a css file is depended on by both css-loader and css-loader/locals for example, both of the outputs of those loaders will be in the same file. Files then depending on those outputs reference the entry chunk and use the exported member for their needed version of the original file.
  3. The EmitChangedAssetsPlugin removes entry chunks that already exist in the destination folder. It also includes package.json for the tested project.
  4. The RunJestWhenDonePlugin runs jest when webpack is done. It runs jest from the destination folder so jest uses the webpack transformed files. This lets jest determine what files changed and which runs to test again instead of testing all the files again.

This way of integrating jest and webpack is fairly transparent, requiring little modification to a webpack project. Used along with source-map-support, you can also get source maps.

Special Thanks

Thanks to Colch for letting me take over development of a jest-webpack integration as the jest-webpack npm package.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].