Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ program.arguments("<folder>").option("-y, --yarn", "Use yarn").option("-f, --for
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/file-mock.js",
"\\.(css|scss|less)$": "identity-obj-proxy"
},
modulePaths: ["src/client/"],
coverageReporters: ["html"]
})

Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ program
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/file-mock.js",
"\\.(css|scss|less)$": "identity-obj-proxy"
},
modulePaths: ["src/client/"],
coverageReporters: ["html"]
}

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-react-matt",
"version": "0.0.66",
"version": "0.0.67",
"description": "React, Redux, Webpack, Babel, Jest, and code coverage all provided for you",
"main": "build-index.js",
"repository": {
Expand Down Expand Up @@ -49,7 +49,8 @@
],
"jest": {
"collectCoverageFrom": [
"src/**/*.{js*}",
"src/client/**/*.{js*}",
"!src/client/browser-history.jsx",
"!src/client/app.jsx",
"!src/client/router.jsx",
"!src/client/actions/sagas/config.jsx",
Expand All @@ -64,6 +65,7 @@
"html",
"lcov"
],
"modulePaths": ["src/client/"],
"globals": {
"localStorage": {}
}
Expand Down
28 changes: 28 additions & 0 deletions test/client/reducers/index.spec.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import rootReducer from "reducers/index";
import initialState from "reducers/initial-state";
import { setInput, setPing } from "actions";

describe("input", () => {
test("When not passing in a state, it should default to initialState.input", () => {
const result = rootReducer(undefined, {});
expect(result.input).toEqual(initialState.input);
});
test(`When passing in a new input, and action type of SET_INPUT,
it should give you a brand new input`, () => {
const input = "hello world!!";
const result = rootReducer(initialState, setInput(input));
expect(result.input).toEqual(input);
});
});

describe("ping", () => {
test("When no state is passed in, initial state should be returned", () => {
const result = rootReducer(undefined, {});
expect(result.ping).toEqual(initialState.ping);
});
test("When you pass in a new ping through an action, it should set the ping", () => {
const ping = "hello";
const result = rootReducer(initialState, setPing(ping));
expect(result.ping).toEqual(ping);
});
});