Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-runner-mocha

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-runner-mocha - npm Package Compare versions

Comparing version 0.0.2-0 to 0.1.0

.babelrc

2

integrationTests/__fixtures__/errorInTest/jest.config.js
module.exports = {
runner: '../../../src/',
runner: '../../../',
};

@@ -1,3 +0,1 @@

const assert = require('assert');
describe('My tests', () => {

@@ -4,0 +2,0 @@ it('This test thows an error', () => {

module.exports = {
runner: '../../../src/',
runner: '../../../',
};
module.exports = {
runner: '../../../src/',
runner: '../../../',
};
module.exports = {
runner: '../../../src/',
runner: '../../../',
};
module.exports = {
testPathIgnorePatterns: ['/examples/', '/node_modules/', '/__mocha__/'],
testMatch: [
'**/__tests__/**/*.js',
'<rootDir>/src/**/__tests__/**/*.js',
'<rootDir>/integrationTests/*.test.js',

@@ -6,0 +6,0 @@ '<rootDir>/integrationTests/**/*.test.js',

{
"name": "jest-runner-mocha",
"version": "0.0.2-0",
"main": "src/index.js",
"version": "0.1.0",
"main": "build/index.js",
"author": "Rogelio Guzman <rogelioguzmanh@gmail.com>",

@@ -16,6 +16,7 @@ "description": "An experimental Mocha runner for Jest",

"lint": "eslint .",
"format": "prettier --single-quote --trailing-comma all --write \"**/*.js\""
"build": "babel src --ignore **/*.test.js,integration -d build",
"postinstall": "yarn build",
"format": "prettier --single-quote --trailing-comma all --write \"!(build)/**/*.js\""
},
"dependencies": {
"babel-register": "6.26.0",
"lodash": "4.17.4",

@@ -28,2 +29,6 @@ "mocha": "3.5.0",

"devDependencies": {
"babel-cli": "6.26.0",
"babel-jest": "21.0.0",
"babel-preset-env": "1.6.0",
"babel-register": "6.26.0",
"eslint": "4.5.0",

@@ -30,0 +35,0 @@ "eslint-config-airbnb-base": "11.3.2",

# jest-runner-mocha
An experimental test runner for Jest that runs Mocha tests within Jest.
[![Build Status](https://travis-ci.org/rogeliog/jest-runner-mocha.svg?branch=master)](https://travis-ci.org/rogeliog/jest-runner-mocha) [![npm version](https://badge.fury.io/js/jest-runner-mocha.svg)](https://badge.fury.io/js/jest-runner-mocha)
An experimental Mocha runner for Jest
This makes it easy to integrate existing Mocha projects with Jest.
![runner](https://user-images.githubusercontent.com/574806/30088955-728bf97e-925e-11e7-9b25-6aac237085ca.gif)
## Usage
Install
### Install
Install `jest`_(it needs Jest 21+)_ and `jest-runner-mocha`
```bash
yarn add --dev jest-runner-mocha
yarn add --dev jest jest-runner-mocha
# or with NPM
npm install --dev jest jest-runner-mocha
```
Add it to your Jest config
### Add it to your Jest config
In your `package.json`
```json
{
"jest": {
"runner": "jest-runner-mocha"
}
}
```
Or in `jest.config.js`
```js

@@ -21,4 +45,4 @@ module.exports = {

Run Jest
```
### Run Jest
```bash
yarn jest

@@ -29,4 +53,2 @@ ```

NOTE: Eventually Jest shoul have a `runnerConfig` option that will eliminate the need for `jest-runner-mocha.config.js`
Create a `jest-runner-mocha.config.js` at the `<rootDir>` or your Jest project.

@@ -51,7 +73,9 @@

_NOTE: Eventually Jest will eventually have an option for configuring runners that will eliminate the need for `jest-runner-mocha.config.js`_
## Known issues
- It does not support Mocha options except for `ui` and `compiler`
- It does not support any Mocha options except for `ui` and `compiler`
- You can't run it with `jest --coverage`
- Support for compilers is very limited.
- Does not support `jest --runInBand`
const toTestResult = require('../toTestResult');
const jestTestPath = 'path/to/file';
const start = +new Date('2000/01/01');
const end = +new Date('2000/01/02'); // Some random end date
const start = Date.UTC(2000, 0, 1, 0, 0, 0, 0);
const end = start + 1000;

@@ -7,0 +7,0 @@ const passingTest = {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc