Skip to content
This repository has been archived by the owner on Nov 15, 2017. It is now read-only.

Commit

Permalink
More tests + added react to babel config
Browse files Browse the repository at this point in the history
  • Loading branch information
swernerx committed Jun 14, 2017
1 parent 767a741 commit 4001c1f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"useBuiltIns": true
}
]
],
"react"
],
"plugins": [
[ "module-resolver", { "root": [ "src" ] }],
Expand Down
21 changes: 15 additions & 6 deletions src/api/common/State.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,30 @@ test("Create Redux Store - No Params", () => {
})

test("Create Redux Store - With Apollo", () => {
const apolloClient = createApolloClient()
expect(apolloClient).toBeDefined()
expect(typeof apolloClient).toBe("object")

const reducers = {}
const middlewares = []
const enhancers = []
const apolloClient = createApolloClient()

expect(createReduxStore({ reducers, middlewares, enhancers, apolloClient })).toBeDefined()
const reduxStore = createReduxStore({ reducers, middlewares, enhancers, apolloClient })
expect(reduxStore).toBeDefined()
expect(typeof reduxStore).toBe("object")
})

test("Create Redux Store - With Apollo and URL", () => {
const apolloClient = createApolloClient()
expect(apolloClient).toBeDefined()
expect(typeof apolloClient).toBe("object")

const reducers = {}
const middlewares = []
const enhancers = []
const apolloClient = createApolloClient({ initialData: { ssr: { apolloUri: "http://my.apollo.uri" } } })

expect(createReduxStore({ reducers, middlewares, enhancers, apolloClient })).toBeDefined()
const initialData = { ssr: { apolloUri: "http://my.apollo.uri" } }
const reduxStore = createReduxStore({ reducers, middlewares, enhancers, initialData, apolloClient })
expect(reduxStore).toBeDefined()
expect(typeof reduxStore).toBe("object")
})

test("Create Root Reducer", () => {
Expand Down

0 comments on commit 4001c1f

Please sign in to comment.