Skip to content

Commit 1d7d501

Browse files
committed
test: testing strict ignore pattern
1 parent 5ec36ce commit 1d7d501

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/lib/rules/no-undef-components.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ tester.run('no-undef-components', rule, {
108108
}
109109
]
110110
},
111+
111112
// circular references
112113
{
113114
filename: 'test.vue',
@@ -685,6 +686,7 @@ tester.run('no-undef-components', rule, {
685686
}
686687
}
687688
],
689+
688690
invalid: [
689691
// <script setup>
690692
{
@@ -843,6 +845,39 @@ tester.run('no-undef-components', rule, {
843845
]
844846
},
845847

848+
// Strict ignore pattern
849+
{
850+
filename: 'test.vue',
851+
code: `
852+
<template>
853+
<FooBar />
854+
</template>
855+
`,
856+
options: [{ ignorePatterns: ['Foo'] }],
857+
errors: [
858+
{
859+
message: "The '<FooBar>' component has been used, but not defined.",
860+
line: 3
861+
}
862+
]
863+
},
864+
865+
{
866+
filename: 'test.vue',
867+
code: `
868+
<template>
869+
<Foo />
870+
</template>
871+
`,
872+
options: [{ ignorePatterns: ['Foo'] }],
873+
errors: [
874+
{
875+
message: "The '<Foo>' component has been used, but not defined.",
876+
line: 3
877+
}
878+
]
879+
},
880+
846881
// options API
847882
{
848883
filename: 'test.vue',

0 commit comments

Comments
 (0)