Skip to content

Commit 005dad3

Browse files
committed
Revert "Replace mocha by jest"
This reverts commit 6e4f43e.
1 parent 6e4f43e commit 005dad3

File tree

5 files changed

+10
-21
lines changed

5 files changed

+10
-21
lines changed

jest.config.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"lint": "eslint ./",
1010
"pretest": "npm run lint",
1111
"test": "npm run unit-test",
12-
"test:watch": "jest --watch",
13-
"unit-test": "jest --coverage"
12+
"unit-test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/lib/**/*.js tests/util/**/*.js tests/index.js"
1413
},
1514
"files": [
1615
"LICENSE",
@@ -38,7 +37,9 @@
3837
"babel-eslint": "^10.0.1",
3938
"coveralls": "^3.0.2",
4039
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0",
41-
"jest": "^24.7.1",
40+
"istanbul": "^0.4.5",
41+
"mocha": "^6.1.4",
42+
"sinon": "^7.2.2",
4243
"typescript": "^3.2.2"
4344
},
4445
"peerDependencies": {

tests/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-env jest */
1+
/* eslint-env mocha */
22
'use strict';
33

44
const plugin = require('..');

tests/util/.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"env": {
3-
"jest": true
3+
"mocha": true
44
}
55
}

tests/util/version.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
const path = require('path');
44
const assert = require('assert');
5+
const sinon = require('sinon');
56
const versionUtil = require('../../lib/util/version');
67

78
describe('Version', () => {
89
const base = path.resolve(__dirname, '..', 'fixtures', 'version');
910
let cwd;
1011
let expectedErrorArgs = [];
11-
let spy;
1212

1313
beforeEach(() => {
1414
cwd = process.cwd();
1515
process.chdir(base);
16-
spy = jest.spyOn(console, 'error').mockImplementation(() => {});
16+
sinon.stub(console, 'error');
1717
expectedErrorArgs = [];
1818
});
1919

2020
afterEach(() => {
2121
process.chdir(cwd);
2222

23-
const actualArgs = console.error.mock.calls; // eslint-disable-line no-console
24-
spy.mockRestore();
23+
const actualArgs = console.error.args; // eslint-disable-line no-console
24+
console.error.restore(); // eslint-disable-line no-console
2525
assert.deepEqual(actualArgs, expectedErrorArgs);
2626
});
2727

0 commit comments

Comments
 (0)