Integration of Jasmine Spec framework with Node.js
Questions tagged [jasmine-node]
327 questions
2
votes
0 answers
Output grunt-jasmine-node to file after running
I am using grunt-jasmine-node to run jasmine-node tests when a file is modified. I do not want to output the jUnit XML file. However, I would love to be able to output the output that displays while running grunt, which is just the jasmine-node…

TorusTorus
- 47
- 8
2
votes
1 answer
Depend Jasmine tests on each other
I try to use jasmine-node tests to test some external API tests. But running the entire test suite does only make sense if the basic connectivity works. So this basically means that I need to hand over that information from a simple ping test to all…

pagid
- 13,559
- 11
- 78
- 104
2
votes
2 answers
'no method expect' when using Protractor as a library
Using Protractor as a library
Unable to require a reference to Jasmine. Referencing the expect method returns output Cannot call method 'expect' of null.
Code updated to reflect comments:
var protractor =…

Dan Hartley
- 21
- 1
- 4
2
votes
2 answers
Spy on Date.now() results in jasmine-node not responding
I am using jasmine-node for doing unit testing. I did below code for mocking Date.now()
spyOn(Date, 'now').andReturn(1387636363717); //always return a fixed time
Then I tried to run jasmine-node spec/ but it stopped working with no output. I could…

Shuping
- 5,388
- 6
- 43
- 66
2
votes
0 answers
Jasmine-Node causing Jenkins to hang after completion
I'm having a few problems getting my CI server to play nicely.
I'm running Jenkins to execute a the Jasmine-Node binary on my unit tests using
node_modules/jasmine-node/bin/jasmine-node tests/ --junitreport
From the output console in Jenkins I can…

user3077277
- 21
- 1
2
votes
1 answer
testing node.js class in module
I'm writing a node.js module and my module has a private class.
I'm trying to write tests against this class, but can't figure out how to do that.
My module looks like this
var main = function(get_item){
var main_item = new MyClass(get_item);
…

pedalpete
- 21,076
- 45
- 128
- 239
2
votes
1 answer
Angularjs and Jasmine : testing with multiple instances of the same service
I'm currently going through the book called 'Mastering Web Application Development with AngularJS' and in one of the examples there is a test called 'Aggregating callbacks'.
The example I've got the problem with contains the Person object:
var…

Spencer Mark
- 5,263
- 9
- 29
- 58
2
votes
0 answers
testing require modules with jasmine in nodejs
I ma trying to load require modules in node to test with jasmine.
Hers my spec runner
var coffee,
isVerbose,
jasmine,
key,
showColors,
sys,
i,
len,
jasmine = require('jasmine-node'),
fs = require("fs"),
sys…

rigaman
- 151
- 2
- 7
2
votes
1 answer
Node.js: How do relative paths in require statements work?
I am using jasmine-node to run jasmine tests. My project has a typical structure with "spec" and "src" folders.
Inside my "HelloSpec.js" file I had:
require('../src/Hello.js');
However when I ran the tests from the project's root folder (ie, the…

Jonah
- 15,806
- 22
- 87
- 161
2
votes
1 answer
failing test not showing in jasmine-node
I have the following basic test for a web service:
var request = require('http'),
url = 'http://localhost:1337/';
describe('webservice', function() {
it('should respond to /ping', function(done) {
request.get(url + 'ping',…

opensas
- 60,462
- 79
- 252
- 386
2
votes
1 answer
Is supertest compatible with express.js 2.5.8?
I am using express.js version 2.5.8 (from legacy code) and am looking to test route loading using supertest. I am having an issue with the server running, but not stopping. I run my tests using jasmine-node, which indicates that my assertion…

jneander
- 1,150
- 14
- 34
2
votes
0 answers
RequireJS text plugin - error when loading HTML template
I'm using RequireJS with the text plugin for my HTML-templates.
define(
[
'text!./../../templates/twitterTemplate.html',
'jquery',
'underscore',
'backbone'
],
function(twitterTemplate, $, _, Backbone) {
var compiled =…

nekman
- 1,919
- 2
- 15
- 26
2
votes
4 answers
How to install jasmine-node (without using 'sudo' ideally)?
So I'm a pretty spoiled rubyist and basically never have to install anything using sudo anymore. I've installed node.js and npm (granted, using the Mac 64-bit .pkg, which could have done gosh knows what on my system) and they work fine.
Now,…

likethesky
- 846
- 3
- 12
- 28
2
votes
1 answer
How to stub out express after you require it with jasmine?
I'm trying to get the code below under test when occurred to me that I already included express at the top of this file. Can you some how monkey patch the express object after it's already loaded?
var express = require('express')
Helper =…

Toran Billups
- 27,111
- 40
- 155
- 268
1
vote
0 answers
"Error [ERR_MODULE_NOT_FOUND]: Cannot find module when running Jasmine tests"
I'm facing an issue while running Jasmine tests for my project. When I execute the command jasmine in my project directory, I encounter the following error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module…

Faris Helmi Permana
- 33
- 2
- 7