jest-runner-mocha
Advanced tools
Comparing version 0.0.2-0 to 0.1.0
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
227659
5
41
558
78
0
13
1
- Removedbabel-register@6.26.0
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedbabel-code-frame@6.26.0(transitive)
- Removedbabel-core@6.26.3(transitive)
- Removedbabel-generator@6.26.1(transitive)
- Removedbabel-helpers@6.24.1(transitive)
- Removedbabel-messages@6.23.0(transitive)
- Removedbabel-register@6.26.0(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedbabel-template@6.26.0(transitive)
- Removedbabel-traverse@6.26.0(transitive)
- Removedbabel-types@6.26.0(transitive)
- Removedbabylon@6.18.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedconvert-source-map@1.9.0(transitive)
- Removedcore-js@2.6.12(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddetect-indent@4.0.0(transitive)
- Removedesutils@2.0.3(transitive)
- Removedglobals@9.18.0(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhome-or-tmp@2.0.0(transitive)
- Removedinvariant@2.2.4(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedjs-tokens@3.0.2(transitive)
- Removedjsesc@1.3.0(transitive)
- Removedjson5@0.5.1(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedprivate@0.1.8(transitive)
- Removedregenerator-runtime@0.11.1(transitive)
- Removedrepeating@2.0.1(transitive)
- Removedslash@1.0.0(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-support@0.4.18(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedto-fast-properties@1.0.3(transitive)
- Removedtrim-right@1.0.1(transitive)