Skip to content

Commit

Permalink
feat(transform_conformance): drop all babel 7 specific tests (#2982)
Browse files Browse the repository at this point in the history
@Dunqing Is this correct?
  • Loading branch information
Boshen authored Apr 14, 2024
1 parent c753c9f commit 9643cba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 28 deletions.
33 changes: 6 additions & 27 deletions tasks/transform_conformance/babel.snap.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Passed: 213/408
Passed: 200/374

# All Passed:
* babel-plugin-transform-react-jsx-source


# babel-preset-typescript (4/23)
# babel-preset-typescript (4/22)
* flow-compat/js-invalid/input.js
* flow-compat/js-valid/input.js
* flow-compat/ts-invalid/input.ts
Expand All @@ -13,7 +13,6 @@ Passed: 213/408
* flow-compat/tsx-valid/input.tsx
* jsx-compat/js-valid/input.js
* jsx-compat/ts-invalid/input.ts
* jsx-compat/ts-invalid-babel-7/input.ts
* jsx-compat/tsx-valid/input.tsx
* node-extensions/import-in-cts/input.cts
* node-extensions/type-assertion-in-cts/input.cts
Expand All @@ -25,18 +24,15 @@ Passed: 213/408
* opts/optimizeConstEnums/input.ts
* opts/rewriteImportExtensions/input.ts

# babel-plugin-transform-typescript (59/164)
# babel-plugin-transform-typescript (49/149)
* class/abstract-allowDeclareFields-false/input.ts
* class/abstract-allowDeclareFields-true/input.ts
* class/abstract-class-decorated/input.ts
* class/abstract-class-decorated-method/input.ts
* class/abstract-class-decorated-parameter/input.ts
* class/accessor-allowDeclareFields-false/input.ts
* class/accessor-allowDeclareFields-true/input.ts
* class/accessor-allowDeclareFields-true-babel-7/input.ts
* class/declare-not-enabled-babel-7/input.ts
* class/decorated-declare-properties/input.ts
* class/field-not-initialized-babel-7/input.ts
* class/parameter-properties/input.ts
* class/parameter-properties-late-super/input.ts
* class/parameter-properties-with-class/input.ts
Expand All @@ -45,8 +41,6 @@ Passed: 213/408
* class/parameter-properties-with-super/input.ts
* class/private-method-override-transform-private/input.ts
* class/transform-properties-declare-wrong-order/input.ts
* class/uninitialized-definite-babel-7/input.ts
* class/uninitialized-definite-with-declare-disabled-babel-7/input.ts
* declarations/erased/input.ts
* declarations/export-declare-enum/input.ts
* declarations/nested-namespace/input.mjs
Expand Down Expand Up @@ -132,35 +126,26 @@ Passed: 213/408
* regression/15768/input.ts
* variable-declaration/non-null-in-optional-chain/input.ts

# babel-preset-react (2/14)
# babel-preset-react (2/13)
* preset-options/development/input.js
* preset-options/development-runtime-automatic/input.js
* preset-options/development-runtime-automatic-windows/input.js
* preset-options/development-windows/input.js
* preset-options/empty-options/input.js
* preset-options/empty-options-babel-7/input.js
* preset-options/runtime-automatic/input.js
* preset-options/runtime-classic/input.js
* preset-options/runtime-classic-pragma-no-frag/input.js
* regression/11294/input.mjs
* regression/another-preset-with-custom-jsx-keep-source-self/input.mjs
* regression/runtime-classic-allow-multiple-source-self/input.mjs

# babel-plugin-transform-react-jsx (131/161)
# babel-plugin-transform-react-jsx (128/148)
* autoImport/auto-import-react-source-type-module/input.js
* autoImport/complicated-scope-module/input.js
* autoImport/react-defined/input.js
* react/adds-appropriate-newlines-when-using-spread-attribute-babel-7/input.js
* react/arrow-functions/input.js
* react/assignment-babel-7/input.js
* react/avoids-spread-babel-7/input.js
* react/does-not-add-source-self-babel-7/input.mjs
* react/handle-spread-with-proto-babel-7/input.js
* react/optimisation.react.constant-elements/input.js
* react/should-add-quotes-es3/input.js
* react/wraps-props-in-react-spread-for-first-spread-attributes-babel-7/input.js
* react/wraps-props-in-react-spread-for-last-spread-attributes-babel-7/input.js
* react/wraps-props-in-react-spread-for-middle-spread-attributes-babel-7/input.js
* react-automatic/arrow-functions/input.js
* react-automatic/concatenates-adjacent-string-literals/input.js
* react-automatic/does-not-add-source-self-automatic/input.mjs
Expand All @@ -171,12 +156,10 @@ Passed: 213/408
* react-automatic/should-add-quotes-es3/input.js
* react-automatic/should-allow-nested-fragments/input.js
* react-automatic/should-escape-xhtml-jsxtext/input.js
* react-automatic/should-escape-xhtml-jsxtext-babel-7/input.js
* react-automatic/should-handle-attributed-elements/input.js
* react-automatic/should-have-correct-comma-in-nested-children/input.js
* react-automatic/should-properly-handle-keys/input.js
* react-automatic/should-throw-when-filter-is-specified/input.js
* runtime/defaults-to-classis-babel-7/input.js

# babel-plugin-transform-react-display-name (15/16)
* display-name/nested/input.js
Expand All @@ -185,12 +168,11 @@ Passed: 213/408
* react-source/arrow-function/input.js
* react-source/disable-with-super/input.js

# babel-plugin-transform-react-jsx-development (0/26)
# babel-plugin-transform-react-jsx-development (0/22)
* cross-platform/disallow-__self-as-jsx-attribute/input.js
* cross-platform/disallow-__source-as-jsx-attribute/input.js
* linux/auto-import-dev/input.js
* linux/classic-runtime/input.js
* linux/classic-runtime-babel-7/input.js
* linux/fragments/input.js
* linux/handle-fragments-with-key/input.js
* linux/handle-nonstatic-children/input.js
Expand All @@ -199,10 +181,8 @@ Passed: 213/408
* linux/source-and-self-defined/input.js
* linux/within-derived-classes-constructor/input.js
* linux/within-ts-module-block/input.ts
* linux/within-ts-module-block-babel-7/input.ts
* windows/auto-import-dev-windows/input.js
* windows/classic-runtime-windows/input.js
* windows/classic-runtime-windows-babel-7/input.js
* windows/fragments-windows/input.js
* windows/handle-fragments-with-key-windows/input.js
* windows/handle-nonstatic-children-windows/input.js
Expand All @@ -211,5 +191,4 @@ Passed: 213/408
* windows/source-and-self-defined-windows/input.js
* windows/within-derived-classes-constructor-windows/input.js
* windows/within-ts-module-block/input.ts
* windows/within-ts-module-block-babel-7/input.ts

13 changes: 12 additions & 1 deletion tasks/transform_conformance/src/test_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ pub trait TestCase {
return true;
}

let dir = self.path().parent().unwrap();
// Skip Babel 7 specific tests
// https://github.com/babel/babel/issues/10746
// We implement Babel 8 breaking changes under the BABEL_8_BREAKING env flag.
// To test the breaking changes, please duplicate the affected tests with the -babel-7 suffix and add BABEL_8_BREAKING: false to test options.
if dir
.file_name()
.is_some_and(|file_name| file_name.to_string_lossy().ends_with("-babel-7"))
{
return true;
}

// Skip deprecated react options
if options.babel_8_breaking.is_some_and(|b| b) {
if let Ok(options) = self.transform_options() {
Expand All @@ -154,7 +166,6 @@ pub trait TestCase {

// babel skip test cases that in a directory starting with a dot
// https://github.com/babel/babel/blob/0effd92d886b7135469d23612ceba6414c721673/packages/babel-helper-fixtures/src/index.ts#L223
let dir = self.path().parent().unwrap();
if dir.file_name().is_some_and(|n| n.to_string_lossy().starts_with('.')) {
return true;
}
Expand Down

0 comments on commit 9643cba

Please sign in to comment.