All Projects → webdriverio-boneyard → Wdio Mocha Framework

webdriverio-boneyard / Wdio Mocha Framework

Licence: mit
A WebdriverIO v4 plugin. Adapter for Mocha testing framework.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Wdio Mocha Framework

Vue Skeleton Mvp
VueJs, Vuetify, Vue Router and Vuex skeleton MVP written on JavaScript using async/await built to work with API REST skeleton: https://github.com/davellanedam/node-express-mongodb-jwt-rest-api-skeleton
Stars: ✭ 406 (+941.03%)
Mutual labels:  mocha
Jest Codemods
Codemods for migrating to Jest https://github.com/facebook/jest 👾
Stars: ✭ 731 (+1774.36%)
Mutual labels:  mocha
Atom Mocha Test Runner
Run your Atom package tests using Mocha
Stars: ✭ 10 (-74.36%)
Mutual labels:  mocha
Mocha
☕️ simple, flexible, fun javascript test framework for node.js & the browser
Stars: ✭ 20,986 (+53710.26%)
Mutual labels:  mocha
Public
Repository for wallaby.js questions and issues
Stars: ✭ 662 (+1597.44%)
Mutual labels:  mocha
Webdriverio
Next-gen browser and mobile automation test framework for Node.js
Stars: ✭ 7,214 (+18397.44%)
Mutual labels:  mocha
React Hot Redux Firebase Starter
🌋 React + Redux + Firebase + Webpack + React Hot Loader 3 + React Router in one boilerplate
Stars: ✭ 375 (+861.54%)
Mutual labels:  mocha
Jobsort
job board that queries hacker news who is hiring job listings from a database and sorts by tech the user knows and how well the user knows them
Stars: ✭ 20 (-48.72%)
Mutual labels:  mocha
Vue Webpack Typescript
A Vue, Webpack, Typescript, Bootstrap setup with hot reload, dynamic imports, unit testing, code coverage, sass, uncss and bundling/minification.
Stars: ✭ 677 (+1635.9%)
Mutual labels:  mocha
Pact Js
JS version of Pact. Pact is a contract testing framework for HTTP APIs and non-HTTP asynchronous messaging systems.
Stars: ✭ 936 (+2300%)
Mutual labels:  mocha
React Progressive Web App
An opinionated React based repository which is optimized for Progressive Web App development.
Stars: ✭ 548 (+1305.13%)
Mutual labels:  mocha
Istanbuljs
monorepo containing the various nuts and bolts that facilitate istanbul.js test instrumentation
Stars: ✭ 656 (+1582.05%)
Mutual labels:  mocha
Calc
Unit Testing in JavaScript
Stars: ✭ 17 (-56.41%)
Mutual labels:  mocha
Jsdom Global
Enable DOM in Node.js
Stars: ✭ 431 (+1005.13%)
Mutual labels:  mocha
Mochawesome
A Gorgeous HTML/CSS Reporter for Mocha.js
Stars: ✭ 860 (+2105.13%)
Mutual labels:  mocha
Enzyme
JavaScript Testing utilities for React
Stars: ✭ 19,781 (+50620.51%)
Mutual labels:  mocha
Unit Test Demo
一步一步介绍如何给项目添加单元测试
Stars: ✭ 766 (+1864.1%)
Mutual labels:  mocha
Chakram
REST API test framework. BDD and exploits promises
Stars: ✭ 912 (+2238.46%)
Mutual labels:  mocha
Tvrboreact
Dream starter project: React, Redux, React Router, Webpack
Stars: ✭ 13 (-66.67%)
Mutual labels:  mocha
Helm Test
A mocha based testing CLI for helm packages
Stars: ✭ 22 (-43.59%)
Mutual labels:  mocha

WDIO Mocha Framework Adapter

Build Status Code Climate Test Coverage Dependency Status


A WebdriverIO plugin. Adapter for Mocha testing framework.

Installation

The easiest way is to keep wdio-mocha-framework as a devDependency in your package.json.

{
  "devDependencies": {
    "wdio-mocha-framework": "~0.5.9"
  }
}

You can simple do it by:

npm install wdio-mocha-framework --save-dev

Instructions on how to install WebdriverIO can be found here.

Configuration

Following code shows the default wdio test runner configuration...

// wdio.conf.js
module.exports = {
  // ...
  framework: 'mocha',

  mochaOpts: {
    ui: 'bdd'
  }
  // ...
};

mochaOpts Options

Options will be passed to the Mocha instance. See the list of supported Mocha options here.

Note that interfaces supported are bdd, tdd and qunit. If you want to provide a custom interface, it should expose methods compatible with them and be named ending with -bdd, -tdd or -qunit accordingly.


mochaOpts.require (string|string[])

The require option is useful when you want to add or extend some basic functionality.
For example, let's try to create an anonymous describe:

wdio.conf.js

{
  suites: {
    login: ['tests/login/*.js']
  },

  mochaOpts: {
    require: './hooks/mocha.js'
  }
}

./hooks/mocha.js

import path from 'path';

let { context, file, mocha, options } = module.parent.context;
let { describe } = context;

context.describe = function (name, callback) {
	if (callback) {
		return describe(...arguments);
	} else {
		callback = name;
		name = path.basename(file, '.js');

		return describe(name, callback);
	}
}

./tests/TEST-XXX.js

describe(() => {
	it('Login form', () => {
		this.skip();
	});
});

Output

TEST-XXX
   ✓ Login form

mochaOpts.compilers (string[])

Use the given module(s) to compile files. Compilers will be included before requires.

CoffeeScript and similar transpilers may be used by mapping the file extensions and the module name.

{
  mochaOpts: {
    compilers: ['coffee:foo', './bar.js']
  }
}

Development

First of all,

npm i

All commands can be found in the package.json. The most important are:

Watch changes:

$ npm run watch

Run tests:

$ npm test

# run test with coverage report:
$ npm run test:cover

Build package:

$ npm run build

For more information on WebdriverIO see the homepage.

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