Skip to content

Commit

Permalink
Precompile assets in the host app before running specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Oct 15, 2024
1 parent e335de2 commit da9288c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tasks/blacklight.rake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'engine_cart/rake_task'

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
RSpec::Core::RakeTask.new(spec: 'blacklight:build_host_assets') do |t|
t.pattern = 'spec/**/*_spec.rb'
end

Expand Down Expand Up @@ -46,15 +46,21 @@ desc "Run test suite"
task ci: ['build:npm'] do
with_solr do
Rake::Task['blacklight:internal:seed'].invoke
within_test_app do
# Precompiles the javascript
system "bin/rake spec:prepare"
end
Rake::Task['blacklight:coverage'].invoke
end
end

namespace :blacklight do
task :build_host_assets do
within_test_app do
# Precompiles the assets
warn "Doing spec:prepare"
`bin/rails spec:prepare`
end
warn "Seeing if we have the blacklight styles"
puts `grep "This file is generated by Blacklight" .internal_test_app/app/assets/builds/application.css`
end

desc "Run tests with coverage"
task :coverage do
ENV['COVERAGE'] = 'true'
Expand Down

0 comments on commit da9288c

Please sign in to comment.