Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-03-19 17:37:08 +0300
committerLin Jen-Shin <godfat@godfat.org>2019-03-19 17:37:08 +0300
commitae9d60ac2b5f439abe040373d0c70ea707d90b9d (patch)
tree31b0bf3862cf317e4d50dbe7dd5e9ba3a888ccfc /lib/tasks
parent645653a49eaafccab3276f52fdfbfaa5c3e3c540 (diff)
parentb789bfaeefd9838c33f13c028893424025ade1ad (diff)
Merge branch '58844-follow-up-from-don-t-create-ee-specific-files-when-creating-emojis-fixture-files' into 'master'
Simplify JavaScriptFixturesHelpers Closes gitlab-ee#10386, #58898, and #58844 See merge request gitlab-org/gitlab-ce!26045
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/karma.rake13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/tasks/karma.rake b/lib/tasks/karma.rake
index 53325d492d1..02987f2beef 100644
--- a/lib/tasks/karma.rake
+++ b/lib/tasks/karma.rake
@@ -1,13 +1,24 @@
unless Rails.env.production?
namespace :karma do
desc 'GitLab | Karma | Generate fixtures for JavaScript tests'
- RSpec::Core::RakeTask.new(:fixtures, [:pattern]) do |t, args|
+ task fixtures: ['karma:copy_emojis_from_public_folder', 'karma:rspec_fixtures']
+
+ desc 'GitLab | Karma | Generate fixtures using RSpec'
+ RSpec::Core::RakeTask.new(:rspec_fixtures, [:pattern]) do |t, args|
args.with_defaults(pattern: '{spec,ee/spec}/javascripts/fixtures/*.rb')
ENV['NO_KNAPSACK'] = 'true'
t.pattern = args[:pattern]
t.rspec_opts = '--format documentation'
end
+ desc 'GitLab | Karma | Copy emojis file'
+ task :copy_emojis_from_public_folder do
+ # Copying the emojis.json from the public folder
+ fixture_file_name = Rails.root.join('spec/javascripts/fixtures/emojis/emojis.json')
+ FileUtils.mkdir_p(File.dirname(fixture_file_name))
+ FileUtils.cp(Rails.root.join('public/-/emojis/1/emojis.json'), fixture_file_name)
+ end
+
desc 'GitLab | Karma | Run JavaScript tests'
task tests: ['yarn:check'] do
sh "yarn run karma" do |ok, res|