Skip to content

Commit a3651e1

Browse files
committed
add tests.
1 parent 6cca458 commit a3651e1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/lib/rules/no-unused-vars.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ tester.run('no-unused-vars', rule, {
2929
{
3030
code: '<template><ol v-for="i in 5"><li :prop="i"></li></ol></template>'
3131
},
32+
{
33+
code: '<template v-for="i in 5"><comp v-for="j in 10">{{i}}{{j}}</comp></template>'
34+
},
35+
{
36+
code: '<template><ol v-for="i in data"><li v-for="f in i">{{ f.bar.baz }}</li></ol></template>'
37+
},
3238
{
3339
code: '<template scope="props">{{props}}</template>'
3440
},
@@ -44,6 +50,14 @@ tester.run('no-unused-vars', rule, {
4450
{
4551
code: '<template scope="props"></template>',
4652
errors: ['\'props\' is defined but never used.']
53+
},
54+
{
55+
code: '<template v-for="i in 5"><comp v-for="j in 10">{{i}}{{i}}</comp></template>',
56+
errors: ['\'j\' is defined but never used.']
57+
},
58+
{
59+
code: '<template><ol v-for="i in data"><li v-for="f in i"></li></ol></template>',
60+
errors: ['\'f\' is defined but never used.']
4761
}
4862
]
4963
})

0 commit comments

Comments
 (0)