Skip to content

Commit

Permalink
add unit test for Store#hasModule(path)
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckFreiburger committed Jun 15, 2017
1 parent 57744da commit 09f3197
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/unit/modules.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ describe('Modules', () => {
getters: { a: state => state.a }
})
}).not.toThrow()

expect(store.hasModule('hi')).toBe(true)

expect(store._mutations.inc.length).toBe(2)
expect(store.state.hi.a).toBe(1)
Expand All @@ -43,6 +45,7 @@ describe('Modules', () => {

// unregister
store.unregisterModule('hi')
expect(store.hasModule('hi')).toBe(false)
expect(store.state.hi).toBeUndefined()
expect(store.getters.a).toBeUndefined()
expect(store._mutations.inc.length).toBe(1)
Expand Down

0 comments on commit 09f3197

Please sign in to comment.