From 52d9cf562eb4d1200608e69453a0cb767bf0e2c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 4 Mar 2022 10:19:34 -0500 Subject: [PATCH] add Babel 8 test cases --- .../test/worker/configuration.skip-bundled.js | 65 +++++++++++++------ 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/eslint/babel-eslint-parser/test/worker/configuration.skip-bundled.js b/eslint/babel-eslint-parser/test/worker/configuration.skip-bundled.js index 9699f125e726..c62736950e01 100644 --- a/eslint/babel-eslint-parser/test/worker/configuration.skip-bundled.js +++ b/eslint/babel-eslint-parser/test/worker/configuration.skip-bundled.js @@ -19,25 +19,50 @@ describe("normalizeParserOptions", () => { expect(result).toHaveProperty("configFile", undefined); }); }); - it("default parserOpts", () => { - const result = normalizeParserOptions({ requireConfigFile: false }); - expect(result.parserOpts).toMatchInlineSnapshot(` - Object { - "allowImportExportEverywhere": false, - "allowReturnOutsideFunction": true, - "allowSuperOutsideMethod": true, - "attachComment": false, - "plugins": Array [ - Array [ - "estree", - Object { - "classFeatures": false, - }, + (process.env.BABEL_8_BREAKING ? it.skip : it)( + "Babel 7 default parserOpts", + () => { + const result = normalizeParserOptions({ requireConfigFile: false }); + expect(result.parserOpts).toMatchInlineSnapshot(` + Object { + "allowImportExportEverywhere": false, + "allowReturnOutsideFunction": true, + "allowSuperOutsideMethod": true, + "attachComment": false, + "plugins": Array [ + Array [ + "estree", + Object { + "classFeatures": false, + }, + ], + ], + "ranges": true, + "tokens": true, + } + `); + }, + ); + (process.env.BABEL_8_BREAKING ? it : it.skip)( + "Babel 8 default parserOpts", + () => { + const result = normalizeParserOptions({ requireConfigFile: false }); + expect(result.parserOpts).toMatchInlineSnapshot(` + Object { + "allowReturnOutsideFunction": false, + "attachComment": false, + "plugins": Array [ + Array [ + "estree", + Object { + "classFeatures": false, + }, + ], ], - ], - "ranges": true, - "tokens": true, - } - `); - }); + "ranges": true, + "tokens": true, + } + `); + }, + ); });