BigW Consortium Gitlab

karma.rake 626 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
unless Rails.env.production?
  namespace :karma do
    desc 'GitLab | Karma | Generate fixtures for JavaScript tests'
    RSpec::Core::RakeTask.new(:fixtures) do |t|
      ENV['NO_KNAPSACK'] = 'true'
      t.pattern = 'spec/javascripts/fixtures/*.rb'
      t.rspec_opts = '--format documentation'
    end

    desc 'GitLab | Karma | Run JavaScript tests'
11
    task tests: ['yarn:check'] do
12
      sh "yarn run karma" do |ok, res|
13 14 15 16 17 18
        abort('rake karma:tests failed') unless ok
      end
    end
  end

  desc 'GitLab | Karma | Shortcut for karma:fixtures and karma:tests'
19
  task karma: ['karma:fixtures', 'karma:tests']
20
end