Commit 257214d
Add environment variable control for testing loading strategies
Makes it easy to reproduce CI failures locally by testing with different
script loading strategies (async vs defer) without code changes.
Changes:
- spec/dummy/config/initializers/react_on_rails.rb: Use REACT_ON_RAILS_LOADING_STRATEGY env var
- spec/dummy/TESTING_LOCALLY.md: Add section on reproducing race condition failures
Usage:
# Test with defer (default, prevents race conditions)
bundle exec rspec spec/system/integration_spec.rb -e "shared_store"
# Test with async (library default for users, may show race conditions)
env REACT_ON_RAILS_LOADING_STRATEGY=async bundle exec rspec spec/system/integration_spec.rb -e "shared_store"
This eliminates the need for .example files and provides a simple,
documented way to test both loading strategies locally.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent b46ece7 commit 257214d
File tree
2 files changed
+51
-1
lines changed- spec/dummy
- config/initializers
2 files changed
+51
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
3 | 48 | | |
4 | 49 | | |
5 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
46 | 51 | | |
0 commit comments