ソースを参照

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()
   })
 })