Skip to content

Commit 48ef00e

Browse files
committed
add comment
1 parent e893f66 commit 48ef00e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/helpers/cases/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import { processInvalidTestCase, processValidTestCase } from './process'
99
export * from './types'
1010
export { processInvalidTestCase, processValidTestCase } from './process'
1111

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+
*/
1216
export function runCases(
1317
{
1418
name,
@@ -20,14 +24,17 @@ export function runCases(
2024
runOptions: { withRequiredFirstOption: boolean; category: CaseCategory },
2125
) {
2226
const usedOptionsKeys = new Set(Object.keys(invalid).concat(Object.keys(valid)))
27+
2328
for (const optionsSetKey of usedOptionsKeys) {
2429
describe(optionsSetKey, () => {
2530
const ruleTester = new RuleTester(typescriptConfig)
31+
2632
ruleTester.run(name, rule as unknown as Rule.RuleModule, {
2733
valid: processValidTestCase(
2834
{ [optionsSetKey]: valid[optionsSetKey] },
2935
runOptions.withRequiredFirstOption,
3036
),
37+
3138
invalid: processInvalidTestCase(
3239
{ [optionsSetKey]: invalid[optionsSetKey] },
3340
runOptions.category,

0 commit comments

Comments
 (0)