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
6
votes
0 answers

grunt-contrib-jasmine with PhantomJS, EJS templates and XMLHttpRequest Exception 101

I'm trying to set up a basic unit test environment for a simple project, but I'm hitting a weird hurdle I have not been able to overcome after hours of research. For some reason, I am getting Error: NETWORK_ERR: XMLHttpRequest Exception 101 returned…
4
votes
1 answer

grunt template jasmine istanbul is not generating coverage report

Im using grunt-template-jasmine-istanbul and grunt-template-jasmine-requirejs. When I run test coverage module, all my test cases are running successfully but no coverage is generated. jasmine: { coverage: { src: [...], …
4
votes
2 answers

how to make work jasmine-ajax with grunt-contrib-jasmine

I am trying to use the jasmine-ajax library to mock ajax request with grunt-contrib-jasmine, but it seems jasmine is not able to find the library (it says jasmine.Ajax is not defined). my grunt file: jasmine: { test:{ …
cesarpachon
  • 1,179
  • 2
  • 10
  • 23
3
votes
1 answer

before- and afterEach leaking in to other tests

I'm using grunt-contrib-jasmine to test my AMD modules. Out of the box it seems like the tests are affecting eachother. The output doesn't separate tests by file. This can be verified by logging something in a tests beforeEach. The same callback is…
Johan
  • 35,120
  • 54
  • 178
  • 293
3
votes
0 answers

nodejs jasmine test fails on 'expect' | 'undefined' is not a function (evaluating 'expect(true).toBe(true)')

I have setup a simple spec: describe("A suite", function() { it("contains spec with an expectation", function() { expect(true).toBe(true); }); }); And when I run grunt jasmine I get: Running "jasmine:src" (jasmine) task Testing jasmine…
jwwishart
  • 2,865
  • 2
  • 23
  • 26
3
votes
1 answer

Any way to output spec runner with grunt-contrib-jasmine?

So I've got grunt-contrib-jasmine running specs in PhantomJS. Is there a way to configure it so it always outputs _specRunner.html (to be run in a browser) instead of only upon errors? I see this in the doc, but how do I configure this…
FlavorScape
  • 13,301
  • 12
  • 75
  • 117
3
votes
2 answers

How to get Grunt-Contrib-Jasmine to execute specs and load dependencies?

The project is: Backbone + Require + Underscore + Grunt + Grunt-Contrib-Jasmine + Grunt-Lib-PhantomJS So two serious problems I've been battling. I know that phantomjs is running properly etc. as I get tons of runtime errors if I include my app src…
FlavorScape
  • 13,301
  • 12
  • 75
  • 117
2
votes
1 answer

Malformed Specrunner file - grunt-template-jasmine-requirejs

I am using grunt-contrib-jasmine with grunt-template-jasmine-requirejs to generate the template. It was all working fine on Node v0.12.14, but when I upgraded to Node v4.5.0, my specrunner file output is malformed. It has chunks of JavaScript in the…
Stormdamage
  • 389
  • 1
  • 5
  • 16
2
votes
0 answers

Error installing grunt-contrib-jasmine

When I try to install it with this command: npm install grunt-contrib-jasmine --save-dev ... I get an error: npm WARN package.json grunt-contrib-connect@0.3.0 No README data npm WARN package.json karma-chrome-launcher@0.1.7 No README data npm WARN…
Garrarufa
  • 1,145
  • 1
  • 12
  • 29
2
votes
1 answer

How to generate only one single XML result with jasmine-report and protractor

I have one single protractor project with following dependencies in packages.json: 'protractor' 'grunt-protractor-runner' 'grunt-jasmine-node' 'jasmine-reporters' I have this protractor-config: exports.config = specs: [ …
2
votes
0 answers

Wrong coverage with Instanbul + Jasmine + Requirejs

I've a small problem with my coverage report. I've got functions tested with jasmine but the coverage report tells me that these functions are not covered. I'm using jasminejs with requirejs to test my code which uses requirejs (with backbone) too.…
1
vote
0 answers

Receiving an unknown provider error while trying to unit test angular 1.5 components

So I'm unit testing a component I made with Angular 1.5. For security purposes, I can't copy and paste that code here, but I can give some mocks. It's a simple component that has some basic selection action, with an binding event when something is…
1
vote
1 answer

Grunt grunt-contrib-jasmine report output to a log file

I am using this lib to create my jasmine test https://github.com/gruntjs/grunt-contrib-jasmine I have the test framework running without problem but when it print out things in console, it contains too much junk info that I do not want, is there…
sefirosu
  • 2,558
  • 7
  • 44
  • 69
1
vote
1 answer

Jasmine 2 Spec has no expectations

I have the following test: describe('when invoked', function() { it('should check something', function() { _.each(someData, function(obj, index) { expect(obj[index].lable).toBe('foo'); }); }); }); When I run Jasmine 2.2.0 it get…
RaduM
  • 2,551
  • 3
  • 21
  • 24
1
vote
1 answer

Jasmine spy document.execCommand is not called

I write a test like this describe('execCommand', function () { it('should call document.execCommand', function () { spyOn(document, 'execCommand').and.callThrough(); expect(document.execCommand).toHaveBeenCalledWith('foreColor',…
tanapoln
  • 479
  • 6
  • 15
1
2 3 4