All Projects → webpack-contrib → Mocha Loader

webpack-contrib / Mocha Loader

Licence: mit
Mocha Loader

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Mocha Loader

Cooky Cutter
🍪 Object factories for testing in TypeScript
Stars: ✭ 109 (-24.83%)
Mutual labels:  mocha
Coffee Loader
CoffeeScript Loader
Stars: ✭ 134 (-7.59%)
Mutual labels:  webpack-loader
Cracking The Coding Interview Javascript Solutions Ctci
Javascript solutions to Cracking the Coding Interview (CTCI)
Stars: ✭ 139 (-4.14%)
Mutual labels:  mocha
Serverless Jest Plugin
Plugin for Serverless Framework which adds support for test-driven development using Jest
Stars: ✭ 111 (-23.45%)
Mutual labels:  mocha
Style Loader
Style Loader
Stars: ✭ 1,572 (+984.14%)
Mutual labels:  webpack-loader
Javascript Testing Best Practices
📗🌐 🚢 Comprehensive and exhaustive JavaScript & Node.js testing best practices (August 2021)
Stars: ✭ 13,976 (+9538.62%)
Mutual labels:  mocha
Webpack Component Loader
📦 A webpack loader to componentify CSS/JS/HTML without framework
Stars: ✭ 105 (-27.59%)
Mutual labels:  webpack-loader
Val Loader
val loader module for webpack
Stars: ✭ 144 (-0.69%)
Mutual labels:  webpack-loader
Ts Mocha
Mocha thin wrapper that allows running TypeScript tests with TypeScript runtime (ts-node) to get rid of compilation complexity
Stars: ✭ 119 (-17.93%)
Mutual labels:  mocha
163music
🎵163 music web app built with Vue 2.6, server side render, webpack 4
Stars: ✭ 139 (-4.14%)
Mutual labels:  mocha
Teaspoon
Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
Stars: ✭ 1,443 (+895.17%)
Mutual labels:  mocha
Transform Loader
transform loader for webpack
Stars: ✭ 116 (-20%)
Mutual labels:  webpack-loader
Ekke
Ekke is a test runner for React-Native, it allows you to execute your test code directly on the device enabling you to test in the same environment as your production users.
Stars: ✭ 137 (-5.52%)
Mutual labels:  mocha
Vue Theme Loader
A webpack loader for supporting multi-site theming with Vue.js
Stars: ✭ 109 (-24.83%)
Mutual labels:  webpack-loader
Null Loader
[DEPRECATED] A loader that returns an empty module (can still be used for webpack 4).
Stars: ✭ 142 (-2.07%)
Mutual labels:  webpack-loader
Webpack Tools
☕️Just a simple webpack sample project.
Stars: ✭ 106 (-26.9%)
Mutual labels:  webpack-loader
Svg Sprite Loader
Webpack loader for creating SVG sprites.
Stars: ✭ 1,822 (+1156.55%)
Mutual labels:  webpack-loader
Breko Hub
Babel React Koa Hot Universal Boilerplate
Stars: ✭ 145 (+0%)
Mutual labels:  mocha
React Permissible
👮‍♂️Making the permission management for React components easier.
Stars: ✭ 145 (+0%)
Mutual labels:  mocha
Snap Shot It
Smarter snapshot utility for Mocha and BDD test runners + data-driven testing!
Stars: ✭ 138 (-4.83%)
Mutual labels:  mocha

DEPRECATED

If you would like to continue to support/maintenance this package please contact me https://twitter.com/alexander_akait

npm node deps tests coverage chat size

mocha-loader

Allows Mocha tests to be loaded and run via webpack.

Getting Started

To begin, you'll need to install mocha-loader and mocha:

npm install --save-dev mocha-loader mocha

Then add the plugin to your webpack config. For example:

file.js

import test from './test.js';

webpack.config.js

module.exports = {
  entry: './entry.js',
  output: {
    path: __dirname,
    filename: 'bundle.js',
  },
  module: {
    rules: [
      {
        test: /test\.js$/,
        use: 'mocha-loader',
        exclude: /node_modules/,
      },
    ],
  },
};

And run webpack via your preferred method.

Alternative usage (without configuration):

import test from 'mocha-loader!./test.js';

No options for loader.

Examples

Basic

file.js

module.exports = true;

test.js

describe('Test', () => {
  it('should succeed', (done) => {
    setTimeout(done, 1000);
  });

  it('should fail', () => {
    setTimeout(() => {
      throw new Error('Failed');
    }, 1000);
  });

  it('should randomly fail', () => {
    if (require('./module')) {
      throw new Error('Randomly failed');
    }
  });
});

Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.

CONTRIBUTING

License

MIT

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