Skip to content

Commit c8f58d1

Browse files
committed
Add tests for React 16 to CI
1 parent db43f02 commit c8f58d1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Diff for: script/convert

+13-3
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,31 @@ new_config = File.expand_path("../spec/dummy/config/webpacker.yml", __dir__)
1313

1414
File.rename(old_config, new_config)
1515

16+
# Shakapacker
1617
gsub_file_content("../Gemfile.development_dependencies", /gem "shakapacker", "[^"]*"/, 'gem "shakapacker", "6.6.0"')
18+
gsub_file_content("../spec/dummy/package.json", /"shakapacker": "[^"]*",/, '"shakapacker": "6.6.0",')
1719

1820
# The below packages don't work on the oldest supported Node version and aren't needed there anyway
1921
gsub_file_content("../package.json", /"eslint": "[^"]*",/, "")
2022
gsub_file_content("../package.json", /"globals": "[^"]*",/, "")
2123
gsub_file_content("../package.json", /"knip": "[^"]*",/, "")
24+
gsub_file_content("../package.json", /"publint": "[^"]*",/, "")
2225
gsub_file_content("../package.json", /"typescript-eslint": "[^"]*",/, "")
2326
gsub_file_content("../package.json", %r{"@arethetypeswrong/cli": "[^"]*",}, "")
2427
gsub_file_content("../package.json", %r{"@eslint/compat": "[^"]*",}, "")
2528
gsub_file_content("../package.json", %r{"@testing-library/dom": "[^"]*",}, "")
2629
gsub_file_content("../package.json", %r{"@testing-library/react": "[^"]*",}, "")
27-
gsub_file_content("../package.json", /"knip": "[^"]*",/, "")
28-
gsub_file_content("../package.json", /"publint": "[^"]*",/, "")
2930

30-
gsub_file_content("../spec/dummy/package.json", /"shakapacker": "[^"]*",/, '"shakapacker": "6.6.0",')
31+
# Switch to the oldest supported React version
32+
gsub_file_content("../package.json", /"react": "[^"]*",/, '"react": "16.0.0",')
33+
gsub_file_content("../package.json", /"react-dom": "[^"]*",/, '"react-dom": "16.0.0",')
34+
# TODO: can't change React version in spec/dummy as well, would need a separate react-16-dummy instead
35+
gsub_file_content(
36+
"../package.json",
37+
"jest node_package/tests",
38+
'jest node_package/tests --testPathIgnorePatterns=\".*(RSC|stream|serverRenderReactComponent).*\" --testNamePattern=\"^(?!.*#react>16).*\"'
39+
)
40+
gsub_file_content("../tsconfig.json", "react-jsx", "react")
3141

3242
gsub_file_content("../spec/dummy/config/webpack/commonWebpackConfig.js", /generateWebpackConfig(\(\))?/,
3343
"webpackConfig")

0 commit comments

Comments
 (0)