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 a7e0d06
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions eslint-bridge/tests/RuleTesterTs.ts
Expand Up @@ -35,17 +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({
Expand All @@ -62,16 +51,14 @@ class RuleTesterTs extends RuleTester {
invalid?: RuleTester.InvalidTestCase[];
},
): void {
tests.valid.forEach(test => {
const setFilename = test => {
if (!test.filename) {
test.filename = placeHolderFilePath;
}
});
tests.invalid.forEach(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 a7e0d06

Please sign in to comment.