Skip to content

Commit 9034bd9

Browse files
committed
Update 2016-02-02-react-redux-unit-testing.md
1 parent bd3a108 commit 9034bd9

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

_posts/2016-02-02-react-redux-unit-testing.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@ Whilst in the initial setup phase of the project I decided to include [Enzyme](h
2727
In this post we'll go through the setup of a React, Redux Webpack application with a focus on getting your reducers tested via mocha and your react components being tested in PhantomJS by using karma. With a focus on being able to keep development fast, structure clean and easy to navigate. Whilst embracing the redux way in structuring your application.
2828

2929
### Folder Structure of our application.
30-
.
31-
├── dist
32-
├── README.md
33-
├── karma.config.js
34-
├── package.json
35-
├── server.dev.js
36-
├── server.js
37-
├── server.prod.js
38-
├── src
39-
│   ├── actions
40-
│   ├── colors.js
41-
│   ├── components
42-
│   ├── containers
43-
│   ├── index.html
44-
│   ├── index.js
45-
│   ├── reducers
46-
│   ├── store
47-
│   └── utils
48-
├── tests.webpack.js
49-
└── webpack.config.js
30+
.
31+
├── dist
32+
├── README.md
33+
├── karma.config.js
34+
├── package.json
35+
├── server.dev.js
36+
├── server.js
37+
├── server.prod.js
38+
├── src
39+
│   ├── actions
40+
│   ├── colors.js
41+
│   ├── components
42+
│   ├── containers
43+
│   ├── index.html
44+
│   ├── index.js
45+
│   ├── reducers
46+
│   ├── store
47+
│   └── utils
48+
├── tests.webpack.js
49+
└── webpack.config.js
5050

5151
karma.config we'll need to load up our components and containers into a browser for testing as we're using postcss and other loaders that don't work natively in node.js. So to get our tests to run in browser we will also include a copy of our webpack config to get karma to load it up. If you load up your tests which rely on webpack loaders down the line you'll get Unexpected token errors.
5252

@@ -92,6 +92,7 @@ describe('Counter Reducer', () => {
9292
```
9393

9494
Reducer:
95+
9596
```
9697
import {createReducer} from '../utils';
9798

0 commit comments

Comments
 (0)