Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting an error when running headless jasmine tests in rails
    primarykey
    data
    text
    <p>I've got a rake task set up to run headless jasmine tests on a build server and output the results in junit format. Here's the task:</p> <pre><code>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 </code></pre> <p>When I run the this I get this error:</p> <pre><code>TypeError: jasmine.getEnv(...).currentSpec is null in http://localhost:34002/assets/jquery.js?body=true (line 1129) expect@http://localhost:34002/assets/jquery.js?body=true:1129 @http://localhost:34002/__spec__/activity_catalog_search_filters_spec.js:15 jasmine.Block.prototype.execute@http://localhost:34002/__jasmine__/jasmine.js:1064 jasmine.Queue.prototype.next_@http://localhost:34002/__jasmine__/jasmine.js:2096 jasmine.Queue.prototype.next_/onComplete/&lt;@http://localhost:34002/__jasmine__/jasmine.js:2086 ... LOTS MORE ... </code></pre> <p>I'm using rails 3.2.13, jasmine 1.3.2, headless 1.0.1, rspec 2.14.1 and Jasmine-jQuery 1.5.8</p> <p>I think it could be similar to the problem this guy is having: <a href="https://stackoverflow.com/questions/10970809/typeerror-jasmine-getenv-currentspec-is-null">TypeError: jasmine.getEnv().currentSpec is null</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload