From f1b5720fc7c76a35c01543b2fd1b76ddd6c1cfe4 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Fri, 5 Mar 2021 19:17:42 +0900 Subject: [PATCH] Remove unstable AST testing (#10462) * Add unstable AST testing for json-stringify parser * Deduplicate yarn.lock * Ignore `tokens` Co-authored-by: fisker Cheung --- package.json | 2 +- src/language-js/printer-estree-json.js | 1 + tests_config/run_spec.js | 21 +-------------------- yarn.lock | 9 +++++---- 4 files changed, 8 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 850b38b5d..874a20a06 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dependencies": { "@angular/compiler": "11.2.3", "@babel/code-frame": "7.12.13", - "@babel/parser": "7.13.4", + "@babel/parser": "7.13.9", "@glimmer/syntax": "0.77.1", "@iarna/toml": "2.2.5", "@typescript-eslint/typescript-estree": "4.15.2", diff --git a/src/language-js/printer-estree-json.js b/src/language-js/printer-estree-json.js index bcfeee92c..105c2ad28 100644 --- a/src/language-js/printer-estree-json.js +++ b/src/language-js/printer-estree-json.js @@ -83,6 +83,7 @@ const ignoredProperties = new Set([ "innerComments", "errors", "range", + "tokens", ]); function clean(node, newNode /*, parent*/) { diff --git a/tests_config/run_spec.js b/tests_config/run_spec.js index f97e8a702..4154ad161 100644 --- a/tests_config/run_spec.js +++ b/tests_config/run_spec.js @@ -47,26 +47,7 @@ const unstableTests = new Map( }) ); -// This is temporary. -// This will be removed once https://github.com/babel/babel/issues/12915 is fixed -const unstableAstTests = new Map( - [ - [ - "flow/function-parentheses/single.js", - (options) => - options.parser.startsWith("babel") && options.arrowParens !== "avoid", - ], - [ - "flow/function-parentheses/test.js", - (options) => options.parser.startsWith("babel"), - ], - ].map((fixture) => { - const [file, isUnstable = () => true] = Array.isArray(fixture) - ? fixture - : [fixture]; - return [path.join(__dirname, "../tests/", file), isUnstable]; - }) -); +const unstableAstTests = new Map(); const espreeDisabledTests = new Set( [ diff --git a/yarn.lock b/yarn.lock index 13e9013d4..1a70a0f89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -283,10 +283,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@7.13.4", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.4": - version "7.13.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.4.tgz#340211b0da94a351a6f10e63671fa727333d13ab" - integrity sha512-uvoOulWHhI+0+1f9L4BoozY7U5cIkZ9PgJqvb041d6vypgUmtVPG4vmGm4pSggjl8BELzvHyUeJSUyEMY6b+qA== +"@babel/parser@7.13.9", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.4": + version "7.13.9" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.9.tgz#ca34cb95e1c2dd126863a84465ae8ef66114be99" + integrity sha512-nEUfRiARCcaVo3ny3ZQjURjHQZUo/JkEw7rLlSZy/psWGnvwXFtPcr6jb7Yb41DVW5LTe6KRq9LGleRNsg1Frw== "@babel/plugin-proposal-async-generator-functions@^7.13.8": version "7.13.8" @@ -3039,6 +3039,7 @@ eslint-plugin-jest@24.1.5: "eslint-plugin-prettier-internal-rules@link:scripts/tools/eslint-plugin-prettier-internal-rules": version "0.0.0" + uid "" eslint-plugin-react@7.22.0: version "7.22.0"