Skip to content

Commit

Permalink
Test specific behavior of javascript:install:rollup
Browse files Browse the repository at this point in the history
This adds test coverage for specific behavior of the
`javascript:install:rollup` command.
  • Loading branch information
jonathanhefner committed Jan 10, 2024
1 parent d6f9ac9 commit 0ec3d28
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/rollup_installer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ class RollupInstallerTest < ActiveSupport::TestCase
include RailsAppHelpers
include SharedInstallerTests

test "rollup installer" do
with_new_rails_app do
out, _err = run_installer

File.read("Procfile.dev").tap do |procfile|
assert_match "js: yarn build --watch", procfile
end

assert_match "STUBBED gem install foreman", out

File.read("rollup.config.js").tap do |rollup_config|
assert_equal File.read("#{__dir__}/../lib/install/rollup/rollup.config.js"), rollup_config
end

assert_match "STUBBED yarn add rollup", out
assert_match %r{STUBBED npm (?:set-script build |pkg set scripts.build=)rollup .*rollup.config.js}, out
assert_match "STUBBED yarn build", out
end
end

private
def run_installer
stub_bins("gem", "yarn", "npm")
Expand Down

0 comments on commit 0ec3d28

Please sign in to comment.