2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
unless Rails.env.production?
|
|
|
|
namespace :karma do
|
2019-10-12 21:52:04 +05:30
|
|
|
# alias exists for legacy reasons
|
2017-08-17 22:00:37 +05:30
|
|
|
desc 'GitLab | Karma | Generate fixtures for JavaScript tests'
|
2019-10-12 21:52:04 +05:30
|
|
|
task fixtures: ['frontend:fixtures']
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
desc 'GitLab | Karma | Run JavaScript tests'
|
|
|
|
task tests: ['yarn:check'] do
|
|
|
|
sh "yarn run karma" do |ok, res|
|
|
|
|
abort('rake karma:tests failed') unless ok
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
desc 'GitLab | Karma | Shortcut for karma:fixtures and karma:tests'
|
|
|
|
task karma: ['karma:fixtures', 'karma:tests']
|
|
|
|
end
|