|
@@ -112,8 +112,8 @@ describe('api: watch', () => {
|
|
|
let dummy
|
|
let dummy
|
|
|
watch([() => state.count, status] as const, (vals, oldVals) => {
|
|
watch([() => state.count, status] as const, (vals, oldVals) => {
|
|
|
dummy = [vals, oldVals]
|
|
dummy = [vals, oldVals]
|
|
|
- let [count] = vals
|
|
|
|
|
- let [, oldStatus] = oldVals
|
|
|
|
|
|
|
+ const [count] = vals
|
|
|
|
|
+ const [, oldStatus] = oldVals
|
|
|
// assert types
|
|
// assert types
|
|
|
count + 1
|
|
count + 1
|
|
|
oldStatus === true
|
|
oldStatus === true
|
|
@@ -412,7 +412,7 @@ describe('api: watch', () => {
|
|
|
|
|
|
|
|
it('warn and not respect deep option when using effect', async () => {
|
|
it('warn and not respect deep option when using effect', async () => {
|
|
|
const arr = ref([1, [2]])
|
|
const arr = ref([1, [2]])
|
|
|
- let spy = jest.fn()
|
|
|
|
|
|
|
+ const spy = jest.fn()
|
|
|
watchEffect(
|
|
watchEffect(
|
|
|
() => {
|
|
() => {
|
|
|
spy()
|
|
spy()
|