Skip to content

Commit

Permalink
remove specs from istanbul instrumented files to have accurated coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Giamir Buoncristiani committed Nov 21, 2016
1 parent c518d12 commit 272cd52
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"presets": ["airbnb"],
"plugins": ["react-hot-loader/babel", "istanbul"]
"plugins": ["react-hot-loader/babel"]
}
9 changes: 8 additions & 1 deletion app/components/TextField/specs/index.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ describe('TextField <TextField />', () => {
expect(onChangeSpy).toHaveBeenCalled();
});

it('should handle enter key down events', () => {
it('should call onEnterKeyDown prop on enter key down events', () => {
const onEnterKeyDownSpy = jasmine.createSpy('onKeyDownSpy');
const renderedComponent = renderComponent({ onEnterKeyDown: onEnterKeyDownSpy });
renderedComponent.find('input').simulate('keyDown', { key: 'Enter' });
expect(onEnterKeyDownSpy).toHaveBeenCalled();
});

it('should not call onEnterKeyDown prop on enter key down events', () => {
const onEnterKeyDownSpy = jasmine.createSpy('onKeyDownSpy');
const renderedComponent = renderComponent({ onEnterKeyDown: onEnterKeyDownSpy });
renderedComponent.find('input').simulate('keyDown', { key: 'Escape' });
expect(onEnterKeyDownSpy).not.toHaveBeenCalled();
});
});
8 changes: 1 addition & 7 deletions app/containers/App/actions.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import { ADD_ITEM, DELETE_ITEM, CHANGE_TEXT_FIELD } from './constants';
import { ADD_ITEM, CHANGE_TEXT_FIELD } from './constants';

export function addItem() {
return {
type: ADD_ITEM
};
}

export function deleteItem() {
return {
type: DELETE_ITEM
};
}

export function changeTextField(value) {
return {
type: CHANGE_TEXT_FIELD,
Expand Down
1 change: 0 additions & 1 deletion app/containers/App/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export const ADD_ITEM = 'ADD_ITEM';
export const DELETE_ITEM = 'DELETE_ITEM';
export const CHANGE_TEXT_FIELD = 'CHANGE_TEXT_FIELD';
3 changes: 3 additions & 0 deletions testing/webpack.test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const webpack = require('webpack');
module.exports = {
devtool: 'inline-source-map',
module: {
preloaders: [
{ test: /\.jsx?$/, loader: 'istanbul', exclude: [/node_modules/, /specs/] }
],
loaders: [
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.css$/, loader: 'null-loader' },
Expand Down

0 comments on commit 272cd52

Please sign in to comment.