
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
This project is a fork of mocha-webpack. We have created this fork since there is no visible activity from original author for a long time.
mocha test runner with integrated webpack precompiler
mochapack is basically a wrapper around the following command...
$ webpack test.js output.js && mocha output.js
... but in a much more powerful & optimized way.
mochapack ...
Benefits over plain mocha
--watch
)Unlike mocha, mochapack analyzes your dependency graph and run only those test files that were affected by this file change.
You'll get continuous feedback whenever you make changes as all tests that are related in any way to this change will be tested again. Isn't that awesome?
If any build errors happens, they will be shown like below
mochapack works with
4.x.x
- 5.x.x
5.x.x
- 8.x.x
Install mochapack via npm install
$ npm install webpack mocha mochapack --save-dev
and use it via npm scripts in your package.json
Further installation and configuration instructions can be found in the installation chapter.
run a single test
mochapack simple.test.js
run all tests by glob
mochapack "test/**/*.js"
Note: You may noticed the quotes around the glob pattern. That's unfortunately necessary as most terminals will resolve globs automatically.
run all tests in directory "test" matching the file pattern *.test.js (add --recursive
to include subdirectories)
mochapack --glob "*.test.js" test
Watch mode? just add --watch
mochapack --watch test
This source code is licensed under the MIT license.
Copyright © 2016-2017 Jan-André Zinser
Copyright © 2018 SysGears (Cyprus) Limited.
FAQs
mocha cli with webpack support
The npm package mochapack receives a total of 40,835 weekly downloads. As such, mochapack popularity was classified as popular.
We found that mochapack demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.