From 6ab25ea159797ca97206796bc82c132a057a1c75 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 12 Apr 2019 12:55:38 -0700 Subject: [PATCH] [Tests] skip a TS test in eslint < 4 --- tests/src/rules/export.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/tests/src/rules/export.js b/tests/src/rules/export.js index 95fb54063..a7a9e8192 100644 --- a/tests/src/rules/export.js +++ b/tests/src/rules/export.js @@ -126,21 +126,25 @@ context('Typescript', function () { }, } + const isLT4 = process.env.ESLINT_VERSION === '3' || process.env.ESLINT_VERSION === '2'; + const valid = [ + test(Object.assign({ + code: ` + export const Foo = 1; + export interface Foo {} + `, + }, parserConfig)), + ] + if (!isLT4) { + valid.unshift(test(Object.assign({ + code: ` + export const Foo = 1; + export type Foo = number; + `, + }, parserConfig))) + } ruleTester.run('export', rule, { - valid: [ - test(Object.assign({ - code: ` - export const Foo = 1; - export type Foo = number; - `, - }, parserConfig), - test(Object.assign({ - code: ` - export const Foo = 1; - export interface Foo {} - `, - }, parserConfig))), - ], + valid: valid, invalid: [], }) })