Integration of Jasmine Spec framework with Node.js
Questions tagged [jasmine-node]
327 questions
1
vote
1 answer
Why should I never ask "How to write a test for that function with jasmine"?
I read this kind of question very often:
How can I test following function with jasmine?
The person who is searching for that answer has searched for examples of jasmine tests and didn't find something which can help him or her.
But there is no…

apxp
- 5,240
- 4
- 23
- 43
1
vote
0 answers
Why is testing a sequelize connection to MySQL causing timeout?
New to node and making a generic express application that connects to MySQL db using sequelize. Doing some unit tests on the db connection with jasmine-node and I keep getting timeouts when i try to connect with sequelize.
// Test the MySQL…

WhyAyala
- 647
- 7
- 29
1
vote
1 answer
How to extend frisby.js with more "expect" functions?
Is there a way to extend the Frisby.js module with custom expect methods? I don't want to modify the source code, these extensions are specific to my REST API. My goal is to avoid repeating common tests by combining them into a method.
The problem…

Brent Washburne
- 12,904
- 4
- 60
- 82
1
vote
1 answer
Istanbul not running all jasmine specs?
I have 24 tests.
jasmine-node spec
........................
Finished in 2.061 seconds
24 tests, 54 assertions, 0 failures, 0 skipped
When I run istanbul, it appears to only run 14 tests.
istanbul cover jasmine-node…

Jared Beck
- 16,796
- 9
- 72
- 97
1
vote
1 answer
Testing Node app with Jasmine for status: 200
I'm writing Jasmine tests for an app I'm building with Node.js and Express. One of the first tests is to see if the app responds with a statusCode of 200. I was working through this tutorial which shows you how to do just that, but I've hit a…

Brent Bartlett
- 33
- 4
1
vote
0 answers
jasmine node+webdriverjs : test client function calls
let's say I got this simple script running in the browser:
function foo(a,b){
return a > b;
}
how can I test this function using webdriverjs and jasmine for node?
Is it even possible to do it? Till now I've been coming across DOM assertion…

Aman Gupta
- 7,883
- 5
- 16
- 24
1
vote
1 answer
jasmine-node async doesn't understand code errors
I am trying jasmine-node with async :
it('should not be dumb', function(done){
Promise.resolve(0).then(function(){
console.log('dumb');
expect(2).toEqual(2);
done();
});
});
returns :
dumb
.
Finished in 0.026 seconds
1 test, 1 assertion, 0…

Arash
- 11,697
- 14
- 54
- 81
1
vote
1 answer
jasmine test case does not return from mongo save
I am using https://github.com/mhevery/jasmine-node to test my nodejs server routes.
My mongoose model has a working pre function as below
userSchema.pre('save', function(next) {
var user = this;
if (!user.isModified('password')) return next();
…

maxboo
- 118
- 8
1
vote
1 answer
Saving jasmine expect() results
Does expect() have a return type (or a promise it fulfills)? If not, how can I store/access the result of an it('should...')'s expect()?
Edited-Clarification: I want to store and use these results during subsequent tests.
Reason: I'd like to make…

Josh Longerbeam
- 100
- 7
1
vote
0 answers
Accessing Iframe inside Iframe
I am working on Angular app, which runs inside non-angular page. On my angular page, i have iframe(iframe2) inside another iframe(iframe1). I am able to move to iframe1 from non angular page, but i am not able to access iframe2 from iframe1 it…

Suk
- 31
- 4
1
vote
1 answer
Why is my jasmine unit test not waiting for 'done'?
I have the test in my node application...
it('will call done', function(done) {
myObj.fn(function(){
done();
}
});
and the code....
myObj.fn = function(success){
setTimeout(2000000000,success);
}
When I…

Exitos
- 29,230
- 38
- 123
- 178
1
vote
0 answers
Error trying to execute tests with Karma - Uncaught ReferenceError: require is not defined
I am trying to ran tests using karma and jasmine, but I am facing this "Uncaught ReferenceError: require is not defined" error. Sorry... could you help me to figure out what am I doing wrong?
Please see my environment, where this error is…

estelisa rva
- 33
- 1
- 5
1
vote
1 answer
How to use another js from some js file?
Recently I am trying to use jasmine-node to run unit test from console.
The problem is that my unit test test.js file is in another directory of the source source.js file.
How do I make sure my unit test test.js file can refer to the method of the…

Adam Lee
- 24,710
- 51
- 156
- 236
1
vote
0 answers
Error: Timed out waiting for the WebDriver server at http://localhost:4444/wd/hub
When I run my webdriverjs, jasmine-node tests I am getting following error.
Error: Timed out waiting for the WebDriver server at http://172.19.35.25:4444/wd/hub
at Error ()
at onResponse…

MANISH ZOPE
- 1,181
- 1
- 11
- 28
1
vote
1 answer
How to see thrown exceptions with jasmine-node?
I'm having trouble seeing exceptions thrown when I test code with jasmine-node. I've tried the --captureExceptions flag with no luck.
Minimal example:
test/mySpec.js
var r = require('./badness.js')
describe("things:", function(){
it("can",…

Bosh
- 8,138
- 11
- 51
- 77