Skip to content

Commit 09f3197

Browse files
add unit test for Store#hasModule(path)
1 parent 57744da commit 09f3197

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: test/unit/modules.spec.js

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ describe('Modules', () => {
2525
getters: { a: state => state.a }
2626
})
2727
}).not.toThrow()
28+
29+
expect(store.hasModule('hi')).toBe(true)
2830

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

4446
// unregister
4547
store.unregisterModule('hi')
48+
expect(store.hasModule('hi')).toBe(false)
4649
expect(store.state.hi).toBeUndefined()
4750
expect(store.getters.a).toBeUndefined()
4851
expect(store._mutations.inc.length).toBe(1)

0 commit comments

Comments
 (0)