빌드 서버에서 헤드리스 재스민 테스트를 실행하고 결과를 junit 형식으로 출력하도록 레이크 작업을 설정했습니다. 여기에 작업입니다 : RSpec에 2.14헤드리스 재스민 테스트를 레일에서 실행할 때 오류 발생
TypeError: jasmine.getEnv(...).currentSpec is null in http://localhost:34002/assets/jquery.js?body=true (line 1129)
[email protected]://localhost:34002/assets/jquery.js?body=true:1129
@http://localhost:34002/__spec__/activity_catalog_search_filters_spec.js:15
[email protected]://localhost:34002/__jasmine__/jasmine.js:1064
[email protected]://localhost:34002/__jasmine__/jasmine.js:2096
jasmine.Queue.prototype.next_/onComplete/<@http://localhost:34002/__jasmine__/jasmine.js:2086
... LOTS MORE ...
내가 사용 레일 3.2.13, 자스민 1.3.2, 헤드리스 (headless) 1.0.1 : 나는 이것을 실행하면
namespace :jasmine do
desc "Runs Jasmine tests headlessly and writes out junit xml."
task :headless_junit do |t, args|
run_jasmine_tests(Dir.pwd)
end
end
def run_jasmine_tests(output_dir)
require 'headless'
require 'jasmine'
require 'rspec'
require 'rspec/core/rake_task'
output_file = "#{output_dir}/jasmine_results.xml"
Headless.ly do
RSpec::Core::RakeTask.new(:jasmine_continuous_integration_runner) do |t|
t.rspec_opts = ['--format', 'RspecJunitFormatter', '--out', output_file ]
t.verbose = true
t.rspec_opts += ["-r #{File.expand_path(File.join(::Rails.root, 'config', 'environment'))}"]
t.pattern = [Jasmine.runner_filepath]
end
Rake::Task['jasmine_continuous_integration_runner'].invoke
end
end
나는이 오류가 발생합니다. TypeError: jasmine.getEnv().currentSpec is null