From 745039d812dd1807d67d1c10941fe830d3f3124b Mon Sep 17 00:00:00 2001 From: vilchik-elena Date: Fri, 31 Jul 2020 10:24:36 +0200 Subject: [PATCH] Remove unused field and refactor duplication --- eslint-bridge/tests/RuleTesterTs.ts | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/eslint-bridge/tests/RuleTesterTs.ts b/eslint-bridge/tests/RuleTesterTs.ts index 1852feb5c5..873937c5b2 100644 --- a/eslint-bridge/tests/RuleTesterTs.ts +++ b/eslint-bridge/tests/RuleTesterTs.ts @@ -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, @@ -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); }