All Projects → sysgears → Mochapack

sysgears / Mochapack

Licence: mit
Mocha test runner with integrated webpack precompiler

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Mochapack

Cadence Web
Web UI for visualizing workflows on Cadence
Stars: ✭ 261 (+57.23%)
Mutual labels:  webpack, mocha
React Redux Universal Boilerplate
An Universal ReactJS/Redux Boilerplate
Stars: ✭ 165 (-0.6%)
Mutual labels:  webpack, mocha
React Hot Redux Firebase Starter
🌋 React + Redux + Firebase + Webpack + React Hot Loader 3 + React Router in one boilerplate
Stars: ✭ 375 (+125.9%)
Mutual labels:  webpack, mocha
Feathers Vue
A boiler plate template using Feathers with Email Verification, Vue 2 with Server Side Rendering, stylus, scss, jade, babel, webpack, ES 6-8, login form, user authorization, and SEO
Stars: ✭ 195 (+17.47%)
Mutual labels:  webpack, mocha
Cookiecutter Webpack
Boilerplate for webpack 2, babel, react + redux + hmr, and karma. Can be inserted into existing django projects.
Stars: ✭ 87 (-47.59%)
Mutual labels:  webpack, mocha
React Progressive Web App
An opinionated React based repository which is optimized for Progressive Web App development.
Stars: ✭ 548 (+230.12%)
Mutual labels:  webpack, mocha
Public
Repository for wallaby.js questions and issues
Stars: ✭ 662 (+298.8%)
Mutual labels:  webpack, mocha
Tvrboreact
Dream starter project: React, Redux, React Router, Webpack
Stars: ✭ 13 (-92.17%)
Mutual labels:  webpack, mocha
App Template
Boilerplate for Angular apps
Stars: ✭ 67 (-59.64%)
Mutual labels:  webpack, mocha
Interactive Image
A jQuery plugin to embed interactive images on your website.
Stars: ✭ 53 (-68.07%)
Mutual labels:  webpack, mocha
React Permissible
👮‍♂️Making the permission management for React components easier.
Stars: ✭ 145 (-12.65%)
Mutual labels:  webpack, mocha
Karma Webpack Example
Karma + Webpack + Mocha + Chai + Istanbul
Stars: ✭ 88 (-46.99%)
Mutual labels:  webpack, mocha
Breko Hub
Babel React Koa Hot Universal Boilerplate
Stars: ✭ 145 (-12.65%)
Mutual labels:  webpack, mocha
Webpack Interview Questions
Webpack questions/answers you can use to prepare for interviews or test your knowledge.
Stars: ✭ 159 (-4.22%)
Mutual labels:  webpack
Javascriptstuff Db
Lists of JavaScript resources: tools, tutorials, starter projects, example code, etc.
Stars: ✭ 163 (-1.81%)
Mutual labels:  webpack
Awesome Vue Cli3 Example
🦅 Awesome example for rapid Vue.js development using vue-cli3 .
Stars: ✭ 160 (-3.61%)
Mutual labels:  webpack
Reactn
React, but with built-in global state management.
Stars: ✭ 1,906 (+1048.19%)
Mutual labels:  webpack
Template Rwb
A full-featured Webpack setup with hot-reload
Stars: ✭ 165 (-0.6%)
Mutual labels:  webpack
Modernizr Loader
Get your modernizr build bundled with webpack
Stars: ✭ 162 (-2.41%)
Mutual labels:  webpack
React Boilerplate
A slightly opinionated yet dead simple boilerplate for React 17.x, Webpack 5 and React Router v5
Stars: ✭ 158 (-4.82%)
Mutual labels:  webpack

mochapack Join the chat at https://gitter.im/sysgears/mochapack npm package Build Status Linux Build Status Windows codecov Twitter Follow

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.

CLI

mochapack ...

  • precompiles your test files automatically with webpack before executing tests
  • handles source-maps automatically for you
  • does not write any files to disk
  • understands globs & all other stuff as test entries like mocha

Benefits over plain mocha

  • has nearly the same CLI as mocha
  • you don't rely on hacky solutions to mock all benefits from webpack, like path resolution
  • mochapack provides a much better watch mode than mocha

Watch mode (--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

CLI

Which version works with mochapack?

mochapack works with

  • webpack in version 4.x.x
  • mocha in versions 5.x.x - 8.x.x

Installation

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.

Sample commands

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

License

This source code is licensed under the MIT license.
Copyright © 2016-2017 Jan-André Zinser
Copyright © 2018 SysGears (Cyprus) Limited.

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].