test-hmr

Testbed for HMR

Usage no npm install needed!

<script type="module">
  import testHmr from 'https://cdn.skypack.dev/test-hmr';
</script>

README

test-hmr

Testbed for Webpack HMR.

Spins Puppeteer + Web Dev Server with a virtual in-memory file system.

Test utils let you pilot the virtual FS, and wait until HMR update has been applied (by detecting the console message: "[HMR] App is up to date.").

Usage

Create a bootstrap file pointing to the app under test:

// test/bootstrap.js
const { bootstrap } = require('test-hmr')

bootstrap()

Require test-hmr to run your tests:

npx mocha --require test-hmr test