Skip to content

Commit 7be99ea

Browse files
justin808claude
andcommitted
Fix CI: Add using_swc? stub to JsDependencyManager spec
The JsDependencyManager tests create a mock test class that includes the module. After adding the using_swc? call to add_js_dependencies, the test class needs to provide this method (which comes from GeneratorHelper in actual generator classes). Changes: - Add using_swc? method stub to test class (defaults to true) - Add using_swc setter for test control - Add test for SWC_DEPENDENCIES constant 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent c9cfc20 commit 7be99ea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

react_on_rails/spec/react_on_rails/generators/js_dependency_manager_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ def destination_root
2626
"/test/path"
2727
end
2828

29+
# Mock using_swc? from GeneratorHelper (defaults to true for SWC testing)
30+
def using_swc?
31+
@using_swc.nil? ? true : @using_swc
32+
end
33+
34+
attr_writer :using_swc
35+
2936
# Test helpers
3037
attr_writer :add_npm_dependencies_result
3138

@@ -109,6 +116,12 @@ def errors
109116
])
110117
end
111118

119+
it "defines SWC_DEPENDENCIES" do
120+
expect(ReactOnRails::Generators::JsDependencyManager::SWC_DEPENDENCIES).to(
121+
eq(%w[@swc/core swc-loader])
122+
)
123+
end
124+
112125
it "does not include Babel presets in REACT_DEPENDENCIES" do
113126
expect(ReactOnRails::Generators::JsDependencyManager::REACT_DEPENDENCIES).not_to include(
114127
"@babel/preset-react"

0 commit comments

Comments
 (0)