Questions tagged [grunt-contrib-jasmine]

A grunt plugin to run Jasmine specs headlessly through PhantomJS

After installation of this plugin using npm install grunt-contrib-jasmine --save-dev you can run a Jasmine task using grunt jasmine.

for more details go to github

46 questions
1
vote
0 answers

Unable to run Code-coverage for Grunt-jsmine-istanbul with requirejs

I have been running jasmine unit-test and used Istanbul for code-coverage for long time but now I have come across a project which uses requirejs and I am unable to run Istanbul-Code-Coverage test for it. The code successful gives runs jasmine test…
1
vote
0 answers

Why running jasmine from cli works but through a grunt task it fails?

When I run jasmine without grunt the test runs perfectly but when run with the grunt jasmine task it fails. I think the reason for this may be because grunt is running the specs with a headless phantom js browser. While the command line jasmine just…
tread
  • 10,133
  • 17
  • 95
  • 170
1
vote
0 answers

Does grunt-contrib-jasmine limit the number of tests?

I'm kind of new to grunt and jasmine, so I hope i'm not wasting your time. I'm getting this error when trying to run more than 29 tests: Warning: PhantomJS failed to load your page. Use --force to continue. Aborted due to warnings. Process…
jonny bordo
  • 549
  • 3
  • 7
  • 17
1
vote
0 answers

running jasmine with grunt

I am trying to run jasmine tests with grunt however I am getting this error message and I am not sure where to go next with resolving it. Here is the actual error message when I try to run jasmine with grunt $ grunt jasmine:all Loading "jasmine.js"…
vertex78
  • 71
  • 1
  • 4
1
vote
1 answer

Unit Test case in Jasmine

I am trying to write a test case for if conditions within a loop, I however do not have it as part of a filter. Is there any way I can test the if conditions within a loop. My test case does not execute this line of code at all. Below is my…
1
vote
0 answers

ReferenceError: Can't find variable: module - Grunt Jasmine

I am using this Grunt file and have set up the Jasmine specs. The grunt file is obviously using the module.export syntax but the jasmine task runs in phantom.js headless browser. So the browser doesn't recognise the module.export syntax. I just…
Vishal Sakaria
  • 1,367
  • 1
  • 17
  • 28
1
vote
1 answer

Karma Jasmine AngularJS testing with real HTTP requests

I want to test my code with real API calls (so I can test the API as well, and when I change the API I don't have to change the JS test as well, and a lot more benefits.) instead of the regular…
Mauro
  • 3,946
  • 2
  • 27
  • 41
1
vote
2 answers

Local Npm module "grunt-template-jasmine-istanbul" not found

Here is my grunt config file - https://github.com/mdarif/JavaScript-Boilerplate/blob/1.3/GruntFile.js It's not loading the module - grunt-template-jasmine-istanbul and getting Local Npm module "grunt-template-jasmine-istanbul" not found. Is it…
1
vote
0 answers

"Error: scripterror: Illegal path or script error" using grunt-template-jasmine-requirejs

I want to use grunt to run jasmine tests automatically. I have never done that before and I am constantly facing errors I don't understand... I want to use grunt-contrib-jasmine and grunt-template-jasmine-requirejs. I added this to my grunt…
Garrarufa
  • 1,145
  • 1
  • 12
  • 29
1
vote
0 answers

An "el" header must exist in DOM

I'm using grunt-contrib-jasmine to do testing with Marionette. My specs pass but I get this error: 'Error: An "el" header must exist in DOM' at the Marionette source. I can't track down the problem My grunt config is: jasmine : { src : [ …
jabbermonkey
  • 1,680
  • 4
  • 19
  • 37
1
vote
1 answer

grunt-contrib-jasmine ReferenceError: Can't find variable: jQuery

Here is my Gruntfile jasmine config task. I've added jquery and jasmine-jquery via vendor options. jasmine: { src: { src: '<%= paths.dist %>/**/*.js', options: { specs: '<%= paths.tests…
Jędrzej Chałubek
  • 1,410
  • 1
  • 16
  • 29
1
vote
1 answer

Why is grunt-contrib-jasmine hanging?

I'm asking this for posterity because it took me some time to figure this out. I have an application that uses require.js and tests based on jasmine, automated with grunt. I have grouped my modules into logical components, each of which is in a…
1
vote
1 answer

Test passing in Jasmine but failing in grunt-contrib-jasmine: document.getElementsByClassName

This test passes when I run it via a webbrowser (safari or chrome) but fails via grunt-contrib-jasmine. TypeError: 'undefined' is not a function (evaluating 'document.getElementsByClassName('video')[0].click()' strangely…
1
vote
1 answer

Grunt Jasmine configuration

In the following Grunt configuration for Jasmine, what is the pivotal property for? // Example configuration grunt.initConfig({ jasmine: { pivotal: { src: 'src/**/*.js', options: { specs: 'spec/*Spec.js', helpers:…
Ben Aston
  • 53,718
  • 65
  • 205
  • 331
1
vote
0 answers

Travis-CI with grunt-contrib-jasmine tests giving false positive

After integrating with Travis-CI I've noticed that false positives are possible when a spec file for some reason throws an error. All the files linted on travis Running "jshint:files" (jshint) task Verifying property jshint.files exists in…
Steve
  • 25,806
  • 2
  • 33
  • 43