Skip to content

Commit

Permalink
Fix tests for Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeNiemiec committed Feb 11, 2020
1 parent 5f53e47 commit 5e6c730
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/rake_tasks_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ def test_rake_task_webpacker_check_binstubs
refute_includes output, "webpack binstubs not found."
end

def test_check_node_version
output = Dir.chdir(test_app_path) { `rake webpacker:check_node 2>&1` }
refute_includes output, "Webpacker requires Node.js"
end

def test_check_yarn_version
output = Dir.chdir(test_app_path) { `rake webpacker:check_yarn 2>&1` }
refute_includes output, "Yarn not installed"
refute_includes output, "Webpacker requires Yarn"
end

def test_rake_webpacker_yarn_install_in_non_production_environments
assert_includes test_app_dev_dependencies, "right-pad"

Expand All @@ -52,16 +63,6 @@ def test_rake_webpacker_yarn_install_in_production_environment
"Expected only production dependencies to be installed"
end

def test_check_node_version
output = Dir.chdir(test_app_path) { `rake webpacker:check_node 2>&1` }
assert_empty output
end

def test_check_yarn_version
output = Dir.chdir(test_app_path) { `rake webpacker:check_yarn 2>&1` }
assert_empty output
end

private
def test_app_path
File.expand_path("test_app", __dir__)
Expand Down

0 comments on commit 5e6c730

Please sign in to comment.