Skip to content

Commit c426e7b

Browse files
Test specific behavior of javascript:install:webpack
This adds test coverage for specific behavior of the `javascript:install:webpack` command.
1 parent 7accf66 commit c426e7b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/webpack_installer_test.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ class WebpackInstallerTest < ActiveSupport::TestCase
55
include RailsAppHelpers
66
include SharedInstallerTests
77

8+
test "webpack installer" do
9+
with_new_rails_app do
10+
out, _err = run_installer
11+
12+
File.read("Procfile.dev").tap do |procfile|
13+
assert_match "js: yarn build --watch", procfile
14+
end
15+
16+
assert_match "STUBBED gem install foreman", out
17+
18+
assert File.exist?("webpack.config.js")
19+
20+
assert_match %r{STUBBED yarn add.* webpack}, out
21+
assert_match %r{STUBBED npm (?:set-script build |pkg set scripts.build=)webpack --config webpack.config.js}, out
22+
assert_match "STUBBED yarn build", out
23+
end
24+
end
25+
826
private
927
def run_installer
1028
stub_bins("gem", "yarn", "npm")

0 commit comments

Comments
 (0)