Skip to content

Commit 607329c

Browse files
Added tests too
1 parent c0616a6 commit 607329c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/lib/rules/require-meta-schema-description.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ module.exports = {
3030
},
3131
create() {}
3232
};
33+
`,
34+
`
35+
module.exports = {
36+
meta: {
37+
schema: [
38+
{
39+
['description']: 'Elements to allow.',
40+
elements: { type: 'string' },
41+
type: 'array',
42+
},
43+
],
44+
},
45+
create() {}
46+
};
3347
`,
3448
`
3549
module.exports = {
@@ -107,6 +121,31 @@ module.exports = {
107121
},
108122
{
109123
code: `
124+
module.exports = {
125+
meta: {
126+
schema: [
127+
{
128+
['de' + 'scription']: 'Computed.',
129+
elements: { type: 'string' },
130+
type: 'array',
131+
},
132+
],
133+
},
134+
create() {}
135+
};
136+
`,
137+
errors: [
138+
{
139+
column: 7,
140+
endColumn: 8,
141+
endLine: 9,
142+
line: 5,
143+
messageId: 'missingDescription',
144+
},
145+
],
146+
},
147+
{
148+
code: `
110149
module.exports = {
111150
meta: {
112151
schema: [

0 commit comments

Comments
 (0)