Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jul 2, 2021
1 parent a4d5979 commit df16c13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/reactivity/reactive.ts
Expand Up @@ -212,7 +212,7 @@ export function shallowReactive(obj: any): any {
export function reactive<T extends object>(obj: T): UnwrapRef<T> {
if (!isObject(obj)) {
if (__DEV__) {
warn('"reactive()" is called without provide an "object".')
warn('"reactive()" must be called on an object.')
}
return obj as any
}
Expand Down
4 changes: 2 additions & 2 deletions test/apis/state.spec.js
Expand Up @@ -92,11 +92,11 @@ describe('api/reactive', () => {
warn = jest.spyOn(global.console, 'error').mockImplementation(() => null)
reactive()
expect(warn.mock.calls[0][0]).toMatch(
'[Vue warn]: "reactive()" is called without provide an "object".'
'[Vue warn]: "reactive()" must be called on an object.'
)
reactive(false)
expect(warn.mock.calls[1][0]).toMatch(
'[Vue warn]: "reactive()" is called without provide an "object".'
'[Vue warn]: "reactive()" must be called on an object.'
)
expect(warn).toBeCalledTimes(2)
warn.mockRestore()
Expand Down
4 changes: 2 additions & 2 deletions test/v3/reactivity/reactive.spec.ts
Expand Up @@ -189,7 +189,7 @@ describe('reactivity/reactive', () => {
expect(
warn.mock.calls.map((call) => {
expect(call[0]).toBe(
'[Vue warn]: "reactive()" is called without provide an "object".'
'[Vue warn]: "reactive()" must be called on an object.'
)
})
)
Expand Down Expand Up @@ -266,7 +266,7 @@ describe('reactivity/reactive', () => {
expect(
warn.mock.calls.map((call) => {
expect(call[0]).toBe(
'[Vue warn]: "shallowReactive()" is called without provide an "object".'
'[Vue warn]: "shallowReactive()" must be called on an object.'
)
})
)
Expand Down

0 comments on commit df16c13

Please sign in to comment.