Questions tagged [jasmine-node]

Integration of Jasmine Spec framework with Node.js

327 questions
0
votes
2 answers

Mock response in API test

I'm attempting to test some API routes and my code coverage is good, but I'm consistently missing the err branch. Below is an example of one of my API route controllers. var index = function(req, res) { request({url: privateUrl + '/players/' +…
MattDionis
  • 3,534
  • 10
  • 51
  • 105
0
votes
1 answer

Testing with jasmine-node : understanding error

I'm trying to learn javascript by doing some of the exercises over on exercism.io (which provides pre-written tests that we need to make pass). It was going okay for a while but with this latest exercise I can't seem to figure out how the tests…
SoSimple
  • 701
  • 9
  • 30
0
votes
1 answer

How to spy on another module in node with Javascript

I have this js module (simplified example): var dbLoader = require('dbLoader'); function MyModule() { this.build(){ return dbLoader.load('yipee'); } } module.exports = MyModule; How on earth do I spyOn(dbLoader,'load') ?? Because when I…
Exitos
  • 29,230
  • 38
  • 123
  • 178
0
votes
0 answers

Unit Test AngularJS service

I have the below AngularJS service class, how can I write Jasmine unit test class for that service? quoteApp.service('TravelInfoService', function() { this.travelAreaTest = function() { return 'TESTVAL'; }; …
0
votes
1 answer

jasmine-node tests aren't running

I have a file word-count.js that looks like this: function words(statement) { words = {} //some code here that does stuff return words } module.exports = words; and a test suite file called…
ApathyBear
  • 9,057
  • 14
  • 56
  • 90
0
votes
1 answer

jasmine is not defined

I am trying to run a rest API test on Enide Studio using friby.js and Jasmine. I got this error: C:\Users\xxxx\AppData\Roaming\npm\node_modules\frisby\lib\frisby.js:1125 jasmine.Matchers.prototype.toMatchOrBeNull = function(expected)…
0
votes
4 answers

Frisby expectJSON containing unordered list

Suppose the following JSON is expected as part of a Frisby test: { array: ["1", "2", "3"] } The array of strings may return in any order, say ["3", "1", "2"]. How can I expect the above defined array without expecting an order? I have…
0
votes
0 answers

Practical, proper inheritance in JavaScript

I'm very new to JavaScript and thought a good assignment would be working through Kent Beck's TDD By Example and doing it in JavaScript instead of Java. Simple inheritance seems to be mystifying as there are many opinions on how to achieve this,…
gzulux
  • 1
  • 1
0
votes
1 answer

Jasmine-node not working properly

I am new to automated testing using jasmine / jasmine-node/ web driver setup. This question is related to jasmine-node module of jasmine. I have created the simple modules in node as follows exports.testFunc = function() { console.log("Inside Test…
MANISH ZOPE
  • 1,181
  • 1
  • 11
  • 28
0
votes
1 answer

jasmine-node and bamboo - test failed

I using jasmine-node for testing node app, and have integration with bamboo, but the problem is when some of the test failed bamboo reports that command jasmine-node test-name.js exits with 1 and that on bamboo job dashboard I have label testless…
Grissom
  • 1,080
  • 8
  • 21
0
votes
0 answers

Grunt: Running tasks after "jasmine_node"

I'm implementing my own XML/HTML-reporting tool for test-automation using grunt, jasmine_node and some other tools. Unfortunately I need to run some tasks right after jasmine_node --> in fact I only use jasmine_node for creating junit xml reports…
0
votes
1 answer

Jasmine junit testing of delegate callback of function args

I have recently started using jasmine to write junit testcase for one of our application. I am stuck at this point on how to call the callBack function of the spied function. setProfile :function(userProfile,callback){ var user; var…
Punith Raj
  • 2,164
  • 3
  • 27
  • 45
0
votes
2 answers

Jasmine spyOn function argument object, as Variables are not defined

I am wiring jasmine test cases for one of the application. I have just started learning jasmine. Below is my script code var aclChecker = function(app,config) { validateResourceAccess = function (req, res, next) { …
Punith Raj
  • 2,164
  • 3
  • 27
  • 45
0
votes
1 answer

How to unit test a particular file node.js using jasmine framework

I have a very simple question. How do I unit test a node.js class/function at a different directory location from my root specs folder? What I mean here is, say I have a specs folder located at root of my project /specs/test-spec.js Here I have a…
mosawi
  • 1,283
  • 5
  • 25
  • 48
0
votes
2 answers

How to mark a jasmine test incomplete?

In Jasmine 2.0 I can use xit instead of it to make jasmine skip the test. Disabling suites I am likely to forget these tests since they don't appear in the result. So I was hoping to mark these tests as incomplete, this should warn me to look at it…
filype
  • 8,034
  • 10
  • 40
  • 66