Skip to content

Commit

Permalink
Switch test runner to jest
Browse files Browse the repository at this point in the history
  • Loading branch information
ahutchings committed Sep 10, 2016
1 parent 17bd843 commit 91dfe05
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ cache:
before_script:
- npm prune
after_success:
- './node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls'
- 'cat coverage/lcov.info | node_modules/.bin/coveralls'
13 changes: 6 additions & 7 deletions lib/__tests__/reducer.spec.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
import test from 'ava';
import reducer from '../reducer';

test('refactor-start', t => {
test('refactor-start', () => {
const state = reducer(undefined, {
type: 'refactor-start',
});

t.deepEqual(state, {
expect(state).toEqual({
refactorInProgress: true,
});
});

test('refactor-end', t => {
test('refactor-end', () => {
const state = reducer(undefined, {
type: 'refactor-end',
});

t.deepEqual(state, {
expect(state).toEqual({
refactorInProgress: false,
});
});

test('unknown action type', t => {
test('unknown action type', () => {
const initialState = {
refactorInProgress: false,
};
const state = reducer(initialState, {
type: 'some-unknown-type',
});

t.true(initialState === state);
expect(initialState).toBe(state);
});
15 changes: 5 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"refactoring-codemods": "0.3.2"
},
"devDependencies": {
"ava": "^0.16.0",
"babel-eslint": "^6.1.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.9.0",
Expand All @@ -62,19 +61,14 @@
"eslint-plugin-jsx-a11y": "^2.0.1",
"eslint-plugin-react": "^6.0.0",
"flow-bin": "^0.32.0",
"nuclide": "^0.167.0",
"nyc": "^8.1.0"
"jest": "^15.1.1",
"nuclide": "^0.167.0"
},
"scripts": {
"test": "npm run test:flow && npm run test:lint && npm run test:unit",
"test:flow": "flow check",
"test:lint": "eslint .",
"test:unit": "nyc ava"
},
"ava": {
"require": [
"babel-register"
]
"test:unit": "jest --coverage"
},
"babel": {
"plugins": [
Expand All @@ -93,7 +87,8 @@
},
"eslintConfig": {
"env": {
"browser": true
"browser": true,
"jest": true
},
"extends": "airbnb",
"parser": "babel-eslint",
Expand Down

0 comments on commit 91dfe05

Please sign in to comment.