Skip to content

Commit

Permalink
chore(test): switched to jest
Browse files Browse the repository at this point in the history
  • Loading branch information
noamokman committed Apr 8, 2017
1 parent c38d80f commit e6aa6e5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
["env", {
"targets": {
"node": 4
}
}]
]
}
19 changes: 15 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"precommit": "npm run lint",
"commitmsg": "validate-commit-msg",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"test": "npm run lint && istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly --report text --report html -- test",
"posttest": "istanbul check-coverage --statements 100 --functions 100 --branches 100 --lines 100"
"test": "npm run lint && jest"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -41,15 +40,27 @@
"http-errors": "^1.6.1"
},
"devDependencies": {
"babel-jest": "^19.0.0",
"babel-preset-env": "^1.3.3",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"coveralls": "^2.13.0",
"eslint": "^3.19.0",
"eslint-config-noamokman": "^5.2.0",
"husky": "^0.13.3",
"istanbul": "^0.4.5",
"mocha": "^3.2.0",
"jest": "^19.0.2",
"npm-run-all": "^4.0.2",
"validate-commit-msg": "^2.12.1"
},
"jest": {
"collectCoverage": true,
"coverageThreshold": {
"global": {
"branches": 100,
"functions": 100,
"lines": 100,
"statements": 100
}
}
}
}
8 changes: 3 additions & 5 deletions test/main.spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
const {expect} = chai;
import chai, {expect} from 'chai';
import chaiAsPromised from 'chai-as-promised';
import empty from '../lib';

chai.use(chaiAsPromised);

describe('http-reject-empty', () => {
const empty = require('../lib');

describe('exports', () => {
it('should expose a function', () => {
expect(empty).to.be.a('function');
Expand Down

0 comments on commit e6aa6e5

Please sign in to comment.