Integration of Jasmine Spec framework with Node.js
Questions tagged [jasmine-node]
327 questions
0
votes
2 answers
How to mock require('child_process').fork(__dirname + '/worker') using jasmine
How to mock const
Source :
child = require('child_process').fork('/worker'); // using jasmine
There are some package for mocking spawn task

Sreeraj
- 31
- 9
0
votes
1 answer
Console.log is executing before browser launches URL
Team,
I am declaring an element as a variable like txtSearch : element(by.xpath('//input[@type="search"]')), in some point I want to log the statement as
var clickOn = function(webElement){
webElement.click();
console.log("Successfully clicked on…

Jothi Vignesh
- 45
- 1
- 6
0
votes
0 answers
Error showing ReferenceError: inject is not defined. trying to get give hit the server using $http
Error thrown:
ReferenceError: inject is not defined.
I'm trying to hit the server using angular $http method. I was able to do the same by using npm require library. When I'm trying to do the same with $http I'm facing an issue.
I got…

venki
- 1
- 2
0
votes
1 answer
Running fs-extra module functions with jasmine doesn't work
When running the tests just using jasmine "node_modules/.bin/jasmine" "spec\test_spec.js"the fs.remove is not called - nothing happens (no error, nothing).
When running tests using jasmine-node "node_modules/.bin/jasmine-node" "spec\test_spec.js"…

pagep
- 3,488
- 1
- 26
- 47
0
votes
1 answer
Completing Promises after runs/waitsFor in Jasmine 1.3
I'm using jasmine-node 1.14.5, which underneath uses jasmine 1.3, and I'm having issues getting runs/waitFor to work properly with Promises.
In certain tests, I'd like to runs/waitFor to wait for a particular condition to happen, and when it…

Galder Zamarreño
- 5,027
- 2
- 26
- 34
0
votes
1 answer
Jasmine-Node only running first test
I am currently attempting to run some tests on my NodeJs Application, however only the first test runs. (I know this as the last test is designed to fail as it is yet to be implimented). Here are my tests.
'use strict'
const request =…

Jack Tidbury
- 183
- 1
- 1
- 12
0
votes
1 answer
How to manipulate API response and assert with jasmine-node
I'm writing an API test driven by Jasmine-node/Frisby.js.
The response has an object that has some epoch time (unix time;13 digits).
I need to assert that time against another epoch time value that is known.
Now, I don't need to be exact on the…

Assaf
- 53
- 1
- 5
0
votes
1 answer
Test if a promise is resolved or rejected with Jasmine 1.3 in Nodejs
I am using the npm library jasmine-node for unit testing of my javascript code. As far as I understand, it uses Jasmine 1.3.
Most of my code involves asynchronous Promises (using ES6 built-in promises, not one of the 3rd party Promise libraries). I…

Paul Chernoch
- 5,275
- 3
- 52
- 73
0
votes
1 answer
Istanbul jasmine-node issue on Windows 7
Trying to run istanbul with jasmine-node
Running: node C:\myproject\project1\node_modules.bin\jasmine-node.CMD
test No coverage information was collected, exit without writing
coverage information
…

Chetan Sachdev
- 738
- 1
- 12
- 31
0
votes
2 answers
How to verify if either 200 or 201 status code in Frisby Test
I'm using frisby v0.8.5 and jasimine-node. With frisby there's the following to assert for expected return http status code:
f = frisby.create(/*stuff....*/);
...
...
f.expectStatus(200);
f.toss();
This works fine if the endpoint has a…

Ray
- 40,256
- 21
- 101
- 138
0
votes
1 answer
Jasmine-node tests always pass
I'm new to BDD and for some reason my code always seem to be passing although I haven't yet written any code. Can somebody please explain why this is happening?
Project setup:
I have a project folder with package.json and a test section with the…

Aiden Pearce
- 35
- 5
0
votes
0 answers
Unable to verify the displayed Label in Login Page
Can any one help me on this scenario.
Scenario: When user try to login the application with invalid credentials then a alert message is displayed on page it self as "Invalid login credentials" and it gets disappear by itself.
Here I am unable to…
0
votes
1 answer
How to test (by jasmine) that a collection exist in my mongo db?
I'm trying to write a spec to test all the collections, I have, in my DB. I'm using Jasmine to test and working on MEAN stack.
Eg: Let says I have Staff, Client, Commission, ... et Cetera. and we wanted to test that this collection exists.
Thanks…

jatinder bhola
- 385
- 1
- 7
- 23
0
votes
1 answer
Testing asyn function using jasmine
I am working on writing the test case for a async function which has callback functions.
This is the function; I am working on.
AuthenticationService.login($scope.username, $scope.password,
function(error){
…

jatinder bhola
- 385
- 1
- 7
- 23
0
votes
1 answer
Jasmine Node javascript promise testing
I want to test some promises with jasmine node. However, the test runs but it says that there are 0 assertions. This is my code, is there something wrong? The then part is successfully called, so if I have a console.log there, it gets called. If I…

luca.p.alexandru
- 1,660
- 5
- 23
- 42