Skip to content

Commit baa166a

Browse files
committed
testing(match-description): Add tests for contexts with parents of ClassExpression and ObjectExpression
1 parent 67e8c5d commit baa166a

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

test/rules/assertions/matchDescription.js

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,51 @@
11
export default {
22
invalid: [
3+
{
4+
code: `
5+
/**
6+
* foo.
7+
*/
8+
const q = class {
9+
10+
}
11+
`,
12+
errors: [
13+
{
14+
line: 3,
15+
message: 'JSDoc description does not satisfy the regex pattern.'
16+
}
17+
],
18+
options: [
19+
{
20+
contexts: [
21+
'ClassExpression'
22+
]
23+
}
24+
]
25+
},
26+
{
27+
code: `
28+
/**
29+
* foo.
30+
*/
31+
const q = {
32+
33+
};
34+
`,
35+
errors: [
36+
{
37+
line: 3,
38+
message: 'JSDoc description does not satisfy the regex pattern.'
39+
}
40+
],
41+
options: [
42+
{
43+
contexts: [
44+
'ObjectExpression'
45+
]
46+
}
47+
]
48+
},
349
{
450
code: `
551
/**
@@ -771,6 +817,38 @@ export default {
771817
noDefaults: true
772818
}
773819
]
820+
},
821+
{
822+
code: `
823+
/**
824+
* foo.
825+
*/
826+
const q = class {
827+
828+
}
829+
`,
830+
options: [
831+
{
832+
contexts: [
833+
]
834+
}
835+
]
836+
},
837+
{
838+
code: `
839+
/**
840+
* foo.
841+
*/
842+
const q = {
843+
844+
};
845+
`,
846+
options: [
847+
{
848+
contexts: [
849+
]
850+
}
851+
]
774852
}
775853
]
776854
};

0 commit comments

Comments
 (0)