mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 21:25:24 +08:00
Add option to run qunit tests in headless chrome (#5054)
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
desc "Runs the qunit test suite"
|
||||
|
||||
task "qunit:test", [:timeout, :qunit_path] => :environment do |_, args|
|
||||
task "qunit:test", [:timeout, :qunit_path, :use_chrome] => :environment do |_, args|
|
||||
|
||||
require "rack"
|
||||
require "socket"
|
||||
|
||||
unless %x{which phantomjs > /dev/null 2>&1}
|
||||
unless %x{which phantomjs > /dev/null 2>&1} || args[:use_chrome]
|
||||
abort "PhantomJS is not installed. Download from http://phantomjs.org"
|
||||
end
|
||||
|
||||
@ -36,7 +36,12 @@ task "qunit:test", [:timeout, :qunit_path] => :environment do |_, args|
|
||||
success = true
|
||||
test_path = "#{Rails.root}/vendor/assets/javascripts"
|
||||
qunit_path = args[:qunit_path] || "/qunit"
|
||||
cmd = "phantomjs #{test_path}/run-qunit.js http://localhost:#{port}#{qunit_path}"
|
||||
|
||||
if args[:use_chrome]
|
||||
cmd = "node #{test_path}/run-qunit-chrome.js http://localhost:#{port}#{qunit_path}"
|
||||
else
|
||||
cmd = "phantomjs #{test_path}/run-qunit.js http://localhost:#{port}#{qunit_path}"
|
||||
end
|
||||
|
||||
options = {}
|
||||
|
||||
|
Reference in New Issue
Block a user