Skip to content

Commit 2f628c3

Browse files
gebilaoxiongyyx990803
authored andcommitted
test:improve reserved props test
1 parent f197d0d commit 2f628c3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: test/unit/features/options/props.spec.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,12 @@ describe('Options props', () => {
490490
})
491491

492492
it('warn reserved props', () => {
493+
const specialAttrs = ['key', 'ref', 'slot', 'is']
493494
new Vue({
494-
props: {
495-
key: String
496-
}
495+
props: specialAttrs
496+
})
497+
specialAttrs.forEach(attr => {
498+
expect(`"${attr}" is a reserved attribute`).toHaveBeenWarned()
497499
})
498-
expect(`"key" is a reserved attribute`).toHaveBeenWarned()
499500
})
500501
})

0 commit comments

Comments
 (0)