Skip to content

Commit

Permalink
[Tests] rule-tester: try this babel class workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath authored and ljharb committed Apr 8, 2024
1 parent d66cde0 commit 5a51b9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/src/rule-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ export function withoutAutofixOutput(test) {
return { ...test, ...usingFlatConfig || { output: test.code } };
}

class FlatCompatRuleTester extends RuleTester {
class FlatCompatRuleTester {
constructor(testerConfig = { parserOptions: { sourceType: 'script' } }) {
super(FlatCompatRuleTester._flatCompat(testerConfig));
this._tester = new RuleTester(FlatCompatRuleTester._flatCompat(testerConfig));
}

run(ruleName, rule, tests) {
super.run(ruleName, rule, {
this._tester.run(ruleName, rule, {
valid: tests.valid.map((t) => FlatCompatRuleTester._flatCompat(t)),
invalid: tests.invalid.map((t) => FlatCompatRuleTester._flatCompat(t)),
});
Expand Down

0 comments on commit 5a51b9a

Please sign in to comment.