]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: prefer const (#865)
authorYang Mingshan <y.mingshan3@gmail.com>
Mon, 23 Mar 2020 15:11:00 +0000 (23:11 +0800)
committerGitHub <noreply@github.com>
Mon, 23 Mar 2020 15:11:00 +0000 (11:11 -0400)
packages/runtime-core/__tests__/apiWatch.spec.ts

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