diff options
| -rw-r--r-- | config/webpack/test.js | 5 | ||||
| -rw-r--r-- | lib/tasks/ci.rake | 13 | ||||
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | spec/javascript/spec_helper.js | 4 | 
4 files changed, 15 insertions, 9 deletions
| diff --git a/config/webpack/test.js b/config/webpack/test.js index d728f40d2..81269f651 100644 --- a/config/webpack/test.js +++ b/config/webpack/test.js @@ -1,8 +1,3 @@  const environment = require('./environment') -import $ from 'jquery'; -global.$ = global.jQuery = $; - -require('bootstrap') -  module.exports = environment.toWebpackConfig() diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index ace042546..3e73b7a3b 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -31,8 +31,14 @@ namespace :ci do      sh "bundle exec bundle-audit check --update"    end -  task :spec do -    sh "bundle exec rake spec" +  task :spec => ["ci:assets","spec"] + +  task :assets do +    sh "RAILS_ENV=test bundle exec rake assets:precompile" +  end + +  task :jest => "ci:assets" do +    sh "node_modules/.bin/jest"    end    desc "Deploy after CI" @@ -47,8 +53,9 @@ namespace :ci do    desc "Clean test files"    task :clean do      sh "rm -rf log/test.log" +    sh "RAILS_ENV=test bundle exec rake assets:clobber"    end  end  desc "Run continuous integration tasks (spec, ...)" -task :ci => ["ci:setup", "ci:spec", "cucumber", "ci:check_security", "ci:deploy", "ci:clean"] +task :ci => ["ci:setup", "ci:spec", "ci:jest", "cucumber", "ci:check_security", "ci:deploy", "ci:clean"] diff --git a/package.json b/package.json index 010f2b606..7e8d695ac 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@        "<rootDir>/spec/javascript"      ],      "setupFiles": [ -      "<rootDir>/config/webpack/test.js" +      "<rootDir>/spec/javascript/spec_helper.js"      ]    }  } diff --git a/spec/javascript/spec_helper.js b/spec/javascript/spec_helper.js new file mode 100644 index 000000000..135995eb2 --- /dev/null +++ b/spec/javascript/spec_helper.js @@ -0,0 +1,4 @@ +import $ from 'jquery'; +global.$ = global.jQuery = $; + +require('bootstrap')
\ No newline at end of file | 
