Skip to content

Commit 38b2368

Browse files
bichikimktsn
authored andcommitted
refactor: fix throwing error style (#1210)
* - fix throwing error style - all throwing error should be starting with lower case * - update test for fixing throwing error style
1 parent d16c906 commit 38b2368

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/store.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class Store {
1717
if (process.env.NODE_ENV !== 'production') {
1818
assert(Vue, `must call Vue.use(Vuex) before creating a store instance.`)
1919
assert(typeof Promise !== 'undefined', `vuex requires a Promise polyfill in this browser.`)
20-
assert(this instanceof Store, `Store must be called with the new operator.`)
20+
assert(this instanceof Store, `store must be called with the new operator.`)
2121
}
2222

2323
const {
@@ -74,7 +74,7 @@ export class Store {
7474

7575
set state (v) {
7676
if (process.env.NODE_ENV !== 'production') {
77-
assert(false, `Use store.replaceState() to explicit replace store state.`)
77+
assert(false, `use store.replaceState() to explicit replace store state.`)
7878
}
7979
}
8080

@@ -441,7 +441,7 @@ function registerGetter (store, type, rawGetter, local) {
441441
function enableStrictMode (store) {
442442
store._vm.$watch(function () { return this._data.$$state }, () => {
443443
if (process.env.NODE_ENV !== 'production') {
444-
assert(store._committing, `Do not mutate vuex store state outside mutation handlers.`)
444+
assert(store._committing, `do not mutate vuex store state outside mutation handlers.`)
445445
}
446446
}, { deep: true, sync: true })
447447
}
@@ -460,7 +460,7 @@ function unifyObjectStyle (type, payload, options) {
460460
}
461461

462462
if (process.env.NODE_ENV !== 'production') {
463-
assert(typeof type === 'string', `Expects string as the type, but found ${typeof type}.`)
463+
assert(typeof type === 'string', `expects string as the type, but found ${typeof type}.`)
464464
}
465465

466466
return { type, payload, options }

test/unit/store.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('Store', () => {
5353
})
5454
expect(() => {
5555
store.commit(undefined, 2)
56-
}).toThrowError(/Expects string as the type, but found undefined/)
56+
}).toThrowError(/expects string as the type, but found undefined/)
5757
expect(store.state.a).toBe(1)
5858
})
5959

@@ -206,7 +206,7 @@ describe('Store', () => {
206206
})
207207
expect(() => {
208208
store.dispatch(undefined, 2)
209-
}).toThrowError(/Expects string as the type, but found undefined/)
209+
}).toThrowError(/expects string as the type, but found undefined/)
210210
expect(store.state.a).toBe(1)
211211
})
212212

@@ -267,7 +267,7 @@ describe('Store', () => {
267267
it('asserts the call with the new operator', () => {
268268
expect(() => {
269269
Vuex.Store({})
270-
}).toThrowError(/Store must be called with the new operator/)
270+
}).toThrowError(/store must be called with the new operator/)
271271
})
272272

273273
it('should accept state as function', () => {

0 commit comments

Comments
 (0)