diff --git a/package.json b/package.json index 979475b5b..94fb7d475 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "build-watch": "webpack --config webpack.config.dev.js --watch", "lint": "eslint .", "pretest": "npm install", - "test": "mocha tests --recursive", - "test-watch": "mocha tests --recursive -w", + "test": "mocha --compilers js:babel-core/register --recursive tests", + "test-watch": "mocha --compilers js:babel-core/register --recursive -w tests", "embed-start": "npm run build && ./bin/www" }, "config": { @@ -69,6 +69,7 @@ "css-loader": "^0.25.0", "eslint": "^3.9.1", "exports-loader": "^0.6.3", + "fetch-mock": "^5.5.0", "hammerjs": "^2.0.8", "immutable": "^3.8.1", "imports-loader": "^0.6.5", @@ -89,6 +90,7 @@ "react-redux": "^4.4.5", "react-router": "^3.0.0", "redux": "^3.6.0", + "redux-mock-store": "^1.2.1", "redux-thunk": "^2.1.0", "regenerator": "^0.8.46", "style-loader": "^0.13.1", diff --git a/client/coral-framework/__tests__/store/authReducer.js b/tests/client/coral-framework/store/authReducer.js similarity index 82% rename from client/coral-framework/__tests__/store/authReducer.js rename to tests/client/coral-framework/store/authReducer.js index dd9f58501..3b2148f7e 100644 --- a/client/coral-framework/__tests__/store/authReducer.js +++ b/tests/client/coral-framework/store/authReducer.js @@ -1,7 +1,7 @@ import { Map } from 'immutable' import {expect} from 'chai' -import authReducer from '../../store/reducers/auth' -import * as actions from '../../store/actions/auth' +import authReducer from '../../../../client/coral-framework/store/reducers/auth' +import * as actions from '../../../../client/coral-framework/store/actions/auth' describe ('authReducer', () => { describe('SET_LOGGED_IN_USER', () => { diff --git a/client/coral-framework/__tests__/store/itemActions.spec.js b/tests/client/coral-framework/store/itemActions.spec.js similarity index 98% rename from client/coral-framework/__tests__/store/itemActions.spec.js rename to tests/client/coral-framework/store/itemActions.spec.js index 948aee32d..124174f36 100644 --- a/client/coral-framework/__tests__/store/itemActions.spec.js +++ b/tests/client/coral-framework/store/itemActions.spec.js @@ -2,7 +2,7 @@ import 'react' import 'redux' import {expect} from 'chai' import fetchMock from 'fetch-mock' -import * as actions from '../../store/actions/items' +import * as actions from '../../../../client/coral-framework/store/actions/items' import {Map} from 'immutable' import configureStore from 'redux-mock-store' diff --git a/client/coral-framework/__tests__/store/itemReducer.spec.js b/tests/client/coral-framework/store/itemReducer.spec.js similarity index 95% rename from client/coral-framework/__tests__/store/itemReducer.spec.js rename to tests/client/coral-framework/store/itemReducer.spec.js index 8a664ac8c..bd7b74b6c 100644 --- a/client/coral-framework/__tests__/store/itemReducer.spec.js +++ b/tests/client/coral-framework/store/itemReducer.spec.js @@ -1,7 +1,7 @@ import { Map, fromJS } from 'immutable' import {expect} from 'chai' -import itemsReducer from '../../store/reducers/items' -import * as actions from '../../store/actions/items' +import itemsReducer from '../../../../client/coral-framework/store/reducers/items' +import * as actions from '../../../../client/coral-framework/store/actions/items' describe ('itemsReducer', () => { describe('ADD_ITEM', () => { diff --git a/client/coral-framework/__tests__/store/notificationReducer.spec.js b/tests/client/coral-framework/store/notificationReducer.spec.js similarity index 83% rename from client/coral-framework/__tests__/store/notificationReducer.spec.js rename to tests/client/coral-framework/store/notificationReducer.spec.js index 4f37034a6..ee30b43bd 100644 --- a/client/coral-framework/__tests__/store/notificationReducer.spec.js +++ b/tests/client/coral-framework/store/notificationReducer.spec.js @@ -1,7 +1,7 @@ import { Map } from 'immutable' import {expect} from 'chai' -import notificationReducer from '../../store/reducers/notification' -import * as actions from '../../store/actions/notification' +import notificationReducer from '../../../../client/coral-framework/store/reducers/notification' +import * as actions from '../../../../client/coral-framework/store/actions/notification' describe ('notificationsReducer', () => { describe('ADD_NOTIFICATION', () => {