Integration of Jasmine Spec framework with Node.js
Questions tagged [jasmine-node]
327 questions
2
votes
2 answers
Jasmine-node expect not executed
I started testing today with Jasmine, which is new to me. Since I am working with a GraphQL-server, developed with NodeJS, I am using jasmine-node.
The following is my first spec I write myself, and I thought it was working:
const request =…

Kenny
- 571
- 5
- 18
2
votes
1 answer
Set Basic Auth Header in Jasmine for testing NodeJS Api
I am currently writing a test suite for an API that I am building however I cannot work out how to set the Basic Auth Header to test certain routes.
I can test normal routes like the following:
describe('Get /', function() {
it('returns…

Jack Tidbury
- 183
- 1
- 1
- 12
2
votes
1 answer
I am getting error "Expected 400 to equal 200"
I have used Frisby framework to write the API test cases. when I put the url and credential into postman or DHC, the responses are coming correctly but in the frisby test cases I am getting error:-
The code is below:-
var frisby =…

Sunil Kumar
- 21
- 2
2
votes
0 answers
How to mock seneca calls in Node.js using jasmine-node?
I am using express module and below is the code of app.js
app.post('/test_url', function(request, response){
seneca.client({type: 'http',port: '3000',host: 'localhost',protocol: 'http'}).act({role: 'sample_role', cmd: 'save',firstname:…

shubhangi
- 21
- 1
2
votes
4 answers
Get Frisby.js tests to run synchronously
I have these API calls in my test that need to run first so I can store the response in a variable to use later. But it looks like my tests are running asynchronously so the second test finishes before the variable gets populated. How can I make the…

cocoa
- 3,806
- 7
- 29
- 56
2
votes
1 answer
TravisCI passes despite tests failing, Gulp setup with tests on Jasmine + Frisby
I'm using the gulp-jasmine-node plugin to run my Jasmine/Frisby.js tests like so:
gulp.task('runJasmine', function() {
return gulp.src(['test/*spec.js'])
.pipe(jasmineNode({
timeout: 10000
}));
});
gulp.task('test',…

krissy
- 21
- 3
2
votes
2 answers
Is there a way to force karma or protractor to execute skipped jasmine tests?
Right now my team is running protractor/jasmine-node for acceptance tests, and karma/jasmine for unit tests.
It's possible, and it has happened, that someone pushes code with iit or ddescribe for protractor/jasmine-node tests, and fit or fdescribe…

Greg H
- 445
- 4
- 12
2
votes
1 answer
Testing certificate expiration with frisby.js or jasmine-node
i am trying to write a testcase with frisby.js that checks the status of the certificate. The test should fail n days before the certificate expires with n being defined in:
config.numberOfDaysBeforeTestFails
I tried it with this code:
var frisby…

pfs
- 21
- 3
2
votes
1 answer
Travis build not finishing properly
I am trying to setup a travis build, except that the test script isn't executing fully. It starts, but then travis says it's exited with code 0 when it's still in the middle of running.
Here is the travis page.
I'm using jasmine-node to run the…

thislooksfun
- 1,049
- 10
- 23
2
votes
1 answer
node.js unit testing mock dependency
I have a question on using proxyquire (or any other suggestions on how to test the following code)
If i have the following file to test:
var path = require('path');
module.exports = function (conf) {
var exported = {};
exported.getIssue =…

Rookie
- 5,179
- 13
- 41
- 65
2
votes
2 answers
Jasmine-node not showing test results
I'm using jasmine-node to run tests for my node.js application. The problem is that if I run the tests one by one with specifying the spec file (jasmine-node spec/file.spec.js) - then everything looks great - I get (as an example) the output such as…

Ostap Lisovyj
- 180
- 2
- 17
2
votes
1 answer
How do I get better terminal output from Jasmine?
I'm using jasmine-node with frisby when I run my tests all I get in the terminal output is red and green dots, I want to see a checklist of all the specs and whether they passed or failed similar to Mocha and Chai.
Any ideas on how to get this…

Joshua Barnett
- 21
- 1
- 2
2
votes
1 answer
error when running protractor with jasmine-reporters
I've installed jasmine reporters using this command:
npm install --save-dev jasmine-reporters@^2.0.0
this is the important part of the config file:
jasmineNodeOpts: {
isVerbose: true,
showColors: true,
defaultTimeoutInterval: 360000,
…

user2880391
- 2,683
- 7
- 38
- 77
2
votes
1 answer
Protractor: how to catch error or timeout on browser.driver.get(url) if remote url is fail to load?
It seems when protractor execute "browser.driver.get(...)" it waits until page is loaded or throw "Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL" message. Remote url is 1 to 10 times…

Victor.Palyvoda
- 523
- 3
- 12
2
votes
1 answer
Jasmine Unit Tests Unexpected this Reference
I am trying to test a fairly simple JavaScript function in Jasmine, however the first statement is throwing an error for being undefined.
myClass.prototype.functiontoBeTested = function() {
var x = this.method()
...
}
The above throws an error in…

Michael
- 668
- 5
- 13