Questions tagged [jasmine-node]

Integration of Jasmine Spec framework with Node.js

327 questions
1
vote
1 answer

Failed: Invalid provider for the NgModule 'DynamicTestModule' - only instances of Provider and Type are allowed, got: [[object Object]?]

So there's this delightful error that's the very definition of annoying this is the describe method: beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ MapMap ], imports: [IonicStorageModule.forRoot()], providers:…
1
vote
0 answers

How to do an async process in jasmine?

Hi guys im new to jasmine and I am currently running some tests. I am not sure if what im doing the correct thing but I the thing is I want to fetch a data first from an api. And then I will loop through the data and construct my it…
Karias Bolster
  • 955
  • 3
  • 17
  • 31
1
vote
2 answers

How to use Jasmine.js spy on a required function

I have this code (Node.js): File: utils.js // utils.js const foo = () => { // .... } const bar = () => { // .... } module.exports = { foo, bar } File: myModule.js // myModule.js const { foo, bar } = require('./utils'); const bizz…
didaquis
  • 93
  • 2
  • 10
1
vote
1 answer

Unable to resolve "Failed: each key must be a number of string; got undefined" in protractor using Typescript

My data file looks like this. Only first set passes but second iteration, it fails at email address export const userTestData = { scenarios: { scenario1: { firstName: 'John', lastName: 'Doe', city:…
Panee S
  • 104
  • 1
  • 9
1
vote
0 answers

How to unit test nested promises with jasmine js?

I am writing some Parse server cloud functions and trying to understand how I ll write a unit test that involve nested promises. e.g Parse.Cloud.define("myfunction", function(request){ const common = require('./common')(Parse); return…
sakhunzai
  • 13,900
  • 23
  • 98
  • 159
1
vote
0 answers

Getting "socket hang up at ClientRequest." when calling GET request using node-fetch

I am using node-fetch modeule along with javascript to work with API requests. Below is my code (just a sample GET operation) var fetch = require('node-fetch'); const HttpsProxyAgent = require('https-proxy-agent'); …
johny
  • 51
  • 1
  • 11
1
vote
2 answers

Jasmine. loop over beforeEach and it

I would like to run a loop over an array with a set of tests including beforeEach setting up corresponding value, and it also using the values from the array. The example below shows the general structure. The problem is myArray is not recognized…
Ron Harlev
  • 16,227
  • 24
  • 89
  • 132
1
vote
1 answer

Testing POST Request using Frisbyjs and Nodejs

I am testing the POST Request to /abc/getme/login with headers as content-type and in the body i m sending an object.My code below: describe('HTTP Method Test for app.js', function() { var frisby = require('frisby'); …
unnamed-bull
  • 361
  • 4
  • 15
1
vote
0 answers

[Frisby]Can't report correctly if test is fail

I wrote RestAPI TEST with frisby.js. If Test result is True, There is no probrem. But If Test result is False, Frisby doesn't report correctly on Linux.(report correctly on windows) following are sample codes: const frisby = require('frisby'); const…
H.H
  • 364
  • 3
  • 11
1
vote
1 answer

How to run a UI workflow for n times and get result in Jasmine it block and perform assertion

I have to execute a UI workflow using nodes-selenium webdriver n times and calculate the average timing and assert it in jasmine it block. I have tried several ways but can't figure out how this can be achieved in Jasmine it() block .
1
vote
1 answer

UnhandledPromiseRejectionWarning Testing Promise Rejection

I'm trying to write a jasmine test that has a spy which .and.returnValues a list of promises. The first several promises are rejections, the last is a success. While the test passes just fine, Node complains with the…
cjbarth
  • 4,189
  • 6
  • 43
  • 62
1
vote
1 answer

How to do OS Profile based Protractor configuration

I am writing a protractor test suite and I want to execute them across different OS platforms. I develop on Windows, hence my primary settings is set according to Windows, but my primary execution environment is linux. The issue is that before I…
1
vote
0 answers

How to exit from a Describe upon a condition(having multiple It's) and proceed to next describe using Protractor Jasmine

I have multiple describes and each describe is an E2E test which contains multiple It blocks which are dependent on each other. When I trigger batch execution(Considering 5 test describes/specs) using protractor.config.js, it read the required…
1
vote
1 answer

jasmine vs jasmine-node test differences

I have been using jasmine and today I thought I would try jasmine-node. Some of the passing tests for jasmine fail in jasmine-node. Specifically, toBeLessThanOrEqual is not a function in jasmine-node. Is jasmine-node something that should be…
FreddyNoNose
  • 478
  • 1
  • 7
  • 13
1
vote
2 answers

Check if any values in an array match an element in the dom and then sendkeys to that element in protractor

I am using jasmine/protractor to run test suites against multiple sites that my company manages. (The sites are order form/checkout sites) Currently, I have a separate test suite set up for each site that uses functions I've created and stored…
Carlosyn
  • 13
  • 4