diff --git a/tasks/transform_conformance/babel.snap.md b/tasks/transform_conformance/babel.snap.md index 48ce9d358ff35..282df51c717de 100644 --- a/tasks/transform_conformance/babel.snap.md +++ b/tasks/transform_conformance/babel.snap.md @@ -1,4 +1,4 @@ -Passed: 94/228 +Passed: 93/227 # All Passed: * babel-plugin-transform-react-jsx-source @@ -137,7 +137,7 @@ Passed: 94/228 * 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 (34/37) +# babel-plugin-transform-react-jsx (33/36) * autoImport/auto-import-react-source-type-module/input.js * autoImport/complicated-scope-module/input.js * autoImport/react-defined/input.js diff --git a/tasks/transform_conformance/src/test_case.rs b/tasks/transform_conformance/src/test_case.rs index ff10b7f933caf..b7bb1573f0cfc 100644 --- a/tasks/transform_conformance/src/test_case.rs +++ b/tasks/transform_conformance/src/test_case.rs @@ -131,24 +131,16 @@ 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() { - if options.react.use_built_ins.is_some() || options.react.use_spread.is_some() { + if let Some(b) = options.babel_8_breaking { + if b { + // Skip deprecated react options + if self.transform_options().as_ref().is_ok_and(|options| { + options.react.use_built_ins.is_some() || options.react.use_spread.is_some() + }) { return true; } + } else { + return true; } } @@ -166,6 +158,7 @@ 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; }