File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ import { processInvalidTestCase, processValidTestCase } from './process'
9
9
export * from './types'
10
10
export { processInvalidTestCase , processValidTestCase } from './process'
11
11
12
+ /**
13
+ * Helper for splitting up test cases by options and displaying info about which
14
+ * set of options the test is running with. Sacrifices some parallelizatiom for debuggability.
15
+ */
12
16
export function runCases (
13
17
{
14
18
name,
@@ -20,14 +24,17 @@ export function runCases(
20
24
runOptions : { withRequiredFirstOption : boolean ; category : CaseCategory } ,
21
25
) {
22
26
const usedOptionsKeys = new Set ( Object . keys ( invalid ) . concat ( Object . keys ( valid ) ) )
27
+
23
28
for ( const optionsSetKey of usedOptionsKeys ) {
24
29
describe ( optionsSetKey , ( ) => {
25
30
const ruleTester = new RuleTester ( typescriptConfig )
31
+
26
32
ruleTester . run ( name , rule as unknown as Rule . RuleModule , {
27
33
valid : processValidTestCase (
28
34
{ [ optionsSetKey ] : valid [ optionsSetKey ] } ,
29
35
runOptions . withRequiredFirstOption ,
30
36
) ,
37
+
31
38
invalid : processInvalidTestCase (
32
39
{ [ optionsSetKey ] : invalid [ optionsSetKey ] } ,
33
40
runOptions . category ,
You can’t perform that action at this time.
0 commit comments