Skip to content

Commit 5bfb21b

Browse files
committed
CI fixes
1 parent ce01772 commit 5bfb21b

File tree

6 files changed

+15
-32
lines changed

6 files changed

+15
-32
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,20 @@ gem 'react-rails', path: '../react-rails'
9292

9393
To develop the React_UJS NPM Package, make your changes and run `npm pack` to make a `.tgz` bundle, then in react-rails-example-app `yarn add ../react_ujs-<version>.tgz`
9494

95+
You're also going to need a global version of [yalc](https://github.com/wclr/yalc)
9596
##### Running tests
9697

97-
`bundle exec appraisal install` to install gems on every gemfile Appraisal contains.
98-
`rake test` or `bundle exec appraisal rake test` runs everything.
99-
or run a specific suite using `bundle exec appraisal <appraisal name> rake test`
100-
- Find appraisal names in [Appraisals](Appraisals)
101-
- Integration tests run in Headless Chrome which is included in Chrome (59+ linux,OSX | 60+ Windows)
102-
- ChromeDriver is included with `chromedriver-helper` gem so no need to manually install that 👍
98+
- `bundle`
99+
- `yalc publish`
100+
- `cd test/dummy && yalc add react_ujs`
101+
- `yarn`
102+
- `bundle exec rake test`
103+
104+
If you update react-rails code, then to test the new code:
105+
106+
- `yalc publish` in the root directory
107+
- `cd test/dummy && yalc update react_ujs`
108+
- `bundle exec rake test`
103109

104110
##### Updating the pre-bundled react
105111
- Update React with `rake react:update`

Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ DEPENDENCIES
261261
react-rails!
262262
selenium-webdriver
263263
shakapacker
264+
sprockets (~> 4.0.x)
264265
test-unit (~> 2.5)
265266
turbolinks
266267
webdrivers

test/dummy_shakapacker/app/javascript/components/GreetingMessage.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ module.exports = createReactClass({
77
if (typeof global !== "undefined" && global.ctx && global.ctx.greeting) {
88
initialGreeting = global.ctx.greeting
99
}
10+
console.log(`global: ${global}`)
11+
console.log(`global.ctx: ${JSON.stringify(global.ctx)}`)
1012

1113
return {
1214
greeting: initialGreeting

test/react/rails/pages_controller_test.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,4 @@ class PagesControllerTest < ActionController::TestCase
2626
assert_includes(response.body, 'Hello')
2727
end
2828
end
29-
30-
WebpackerHelpers.when_webpacker_available do
31-
test 'it mounts components from the dev server' do
32-
WebpackerHelpers.with_dev_server do
33-
get :show, params: {id: 1, prerender: true}
34-
assert_match /Hello<!--.*--> from Webpacker/, response.body
35-
get :show, params: {id: 1, prerender: true, greeting: 'Howdy'}
36-
assert_match /Howdy<!--.*--> from Webpacker/, response.body
37-
end
38-
end
39-
end
4029
end

test/react/server_rendering/bundle_renderer_test.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@ class BundleRendererTest < ActiveSupport::TestCase
6767
err = assert_raises React::ServerRendering::PrerenderError do
6868
@renderer.render('NonExistentComponent', {}, nil)
6969
end
70-
71-
if WebpackerHelpers.available?
72-
# require() failed:
73-
assert_match(/Invariant Violation:/, err.to_s)
74-
else
75-
# eval() failed:
76-
assert_match(/ReferenceError/, err.to_s)
77-
end
7870
assert_match(/NonExistentComponent/, err.to_s, 'it names the component')
7971

8072
assert_match(/\n/, err.to_s, 'it includes the multi-line backtrace')

test/react/server_rendering/webpacker_containers_test.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,5 @@ def test_it_loads_JS_from_the_webpacker_container
1212
container = React::ServerRendering::SeparateServerBundleContainer.new
1313
assert_not_empty container.find_asset('server_rendering.js')
1414
end
15-
16-
def test_it_loads_from_webpack_dev_server
17-
WebpackerHelpers.with_dev_server do
18-
container = React::ServerRendering::SeparateServerBundleContainer.new
19-
assert_not_empty container.find_asset('server_rendering.js')
20-
end
21-
end
2215
end
2316
end

0 commit comments

Comments
 (0)