-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.configure do |config| | ||
config.before(:all) do | ||
raise "Rails.root directory does not exist" unless Rails.root.exist? | ||
raise "package.json file does not exist" unless Rails.root.join("package.json").exist? | ||
|
||
Dir.chdir(Rails.root) { Webpacker.compile } | ||
rescue Errno::ENOENT | ||
node_modules_contents = `ls #{Rails.root.join("node_modules")}` | ||
|
||
message = <<~ERROR | ||
There was an error during the Webpacker compilation | ||
#{"=" * 80} | ||
Node version: #{`node -v`} | ||
#{"=" * 80} | ||
NPM version: #{`npm -v`} | ||
#{"=" * 80} | ||
Node modules packages: #{`npm list`} | ||
#{"=" * 80} | ||
Node modules contents: #{node_modules_contents} | ||
#{"=" * 80} | ||
ERROR | ||
|
||
raise message | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters