Skip to content

Commit

Permalink
Remove unused field and refactor duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
vilchik-elena committed Jul 31, 2020
1 parent 4cd6ae2 commit 745039d
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions eslint-bridge/tests/RuleTesterTs.ts
Expand Up @@ -35,18 +35,6 @@ const placeHolderFilePath = path.resolve(`${__dirname}/fixtures/rule-tester-proj
* It will also assert that no issues is raised when there are no type information.
*/
class RuleTesterTs extends RuleTester {
ruleTesterNoTsConfig = new RuleTester({
parser,
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
globalReturn: true,
},
},
});

constructor(public expectNoIssuesWithoutTypes = true) {
super({
parser,
Expand All @@ -62,16 +50,14 @@ class RuleTesterTs extends RuleTester {
invalid?: RuleTester.InvalidTestCase[];
},
): void {
tests.valid.forEach(test => {
if (!test.filename) {
test.filename = placeHolderFilePath;
}
});
tests.invalid.forEach(test => {
const setFilename = test => {
if (!test.filename) {
test.filename = placeHolderFilePath;
}
});
};

tests.valid.forEach(setFilename);
tests.invalid.forEach(setFilename);

super.run(name, rule, tests);
}
Expand Down

0 comments on commit 745039d

Please sign in to comment.