forked from renchap/webpacker-react
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
34 lines (27 loc) · 833 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require "bundler/gem_tasks"
require "rake/testtask"
require "English"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
t.verbose = true
end
task default: :test
# webpacker:check_webpack_binstubs is looking for binstubs
# in the gem root directory. We need to disable it for our
# tests, as it tries to check they exist when loading the
# example app
task "webpacker:check_webpack_binstubs"
Rake::Task["webpacker:check_webpack_binstubs"].clear
namespace :example_app do
desc "Runs yarn in test/example_app"
task :yarn do
sh "cd test/example_app && yarn"
end
desc "Runs webpack in test/example_app"
task webpack: :yarn do
sh "cd test/example_app && RAILS_ENV=test ./bin/webpack"
end
end
Rake::Task["test"].enhance ["example_app:webpack"]