Преглед на файлове

test:improve reserved props test

gebilaoxiong преди 9 години
родител
ревизия
2f628c3114
променени са 1 файла, в които са добавени 5 реда и са изтрити 4 реда
  1. 5 4
      test/unit/features/options/props.spec.js

+ 5 - 4
test/unit/features/options/props.spec.js

@@ -490,11 +490,12 @@ describe('Options props', () => {
   })
 
   it('warn reserved props', () => {
+    const specialAttrs = ['key', 'ref', 'slot', 'is']
     new Vue({
-      props: {
-        key: String
-      }
+      props: specialAttrs
+    })
+    specialAttrs.forEach(attr => {
+      expect(`"${attr}" is a reserved attribute`).toHaveBeenWarned()
     })
-    expect(`"key" is a reserved attribute`).toHaveBeenWarned()
   })
 })