Questions tagged [frisby.js]

REST API Testing framework for Node.js

Quoting Official web page,

Frisby is a REST API testing framework built on node.js and Jasmine that makes testing API endpoints easy, fast, and fun.

81 questions
14
votes
4 answers

jest doesn't wait beforeAll resolution to start tests

What I test: An express server endpoints My goal: automate API tests in a single script What I do: I launch the express server in a NodeJS child process and would like to wait for it to be launched before the test suite is run (frisby.js endpoints…
3Dos
  • 3,210
  • 3
  • 24
  • 37
11
votes
2 answers

before/afterAll() is not defined in jasmine-node

I'm trying to use the methods beforeAll and afterAll of jasmine, to create a suite of tests with frisby.js, because actually, frisby doesn't have a support for this methods. So, this is what I'm trying to do: var frisby =…
11
votes
4 answers

Test how API handles invalid JSON syntax request body using node.js

I would like to test how an REST API handles a POST request that has a body with invalid JSON syntax, for example a missing comma. I'm using node.js to write the API tests. I'm using frisby but I also tried supertest. No luck. With the previous…
alefteris
  • 1,126
  • 8
  • 21
5
votes
1 answer

How can I solve the Jest message "Jest did not exit one second after the test run has completed."?

We are using frisby.js for our automated API tests and frisby.js uses Jest as test runner. Now in our case we do a global setup before executing all API tests and after the test execution we do a global teardown. This global setup and teardown I've…
GRme
  • 2,707
  • 5
  • 26
  • 49
4
votes
1 answer

REST API Testing: HTTP Post returns 500 with Frisby.js

I am using Frisby.js to submit a POST request with JSON data and test the JSON response. However, my query returns HTTP Status 500. The same POST request works fine in CURL in my command line, as well as Postman. What could be the problem? CURL…
A. Ganesh
  • 71
  • 1
  • 3
4
votes
1 answer

Is there a way to send a JPG with Jasmine NodeJS?

I'm trying to test out my API using FrisbyJS (which sits on top of Jasmine for Node). I was wondering if anyone knew how to submit/send an image using Jasmine? http://frisbyjs.com/ My current code is... var frisby = require('frisby'); var URL =…
user766987
  • 692
  • 1
  • 8
  • 17
3
votes
0 answers

Jest/Frisby - FetchError: invalid json response body; how to log the server response

I probably have an error on my server, because I get this from frisby: FetchError: invalid json response body at ... The problem is that I'm not able to see the server response, so I cannot understand what's going wrong. How can I log the server…
exetera
  • 41
  • 4
3
votes
1 answer

Am I able to output and view Frisby.js requests?

I'm getting started with frisby.js and I'm also new to Jasmine and node.js. After stumbling over some of my first frisby tests, I wanted to know if it were possible to output the requests in my tests to the console so that I could validate I have…
jjelly
  • 73
  • 9
3
votes
1 answer

Rest api testing with Frisby.js

I have the following test, written with Frisby.js : var frisby = require('frisby'); var CONSTS = { server: 'http://localhost:8000', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' …
vlio20
  • 8,955
  • 18
  • 95
  • 180
3
votes
2 answers

Get method of frisby does not work with https

I am new to frisby test. today i found I can't access https://ip address from friby api for example: frisby.create('my test').get("https://199.59.148.20") output: connect error frisby.create('my test').get("https://api.twitter.com") this one…
cppython
  • 1,209
  • 3
  • 20
  • 30
3
votes
1 answer

how to validate xml response from rest call using frisby

Need to validate below xml response using frisby false true
user3121600
  • 131
  • 3
  • 8
2
votes
1 answer

Generating Test Coverage for Rest API Tests with frisby.js

I'm using frisby.js for implementing automated Rest API tests together with Mocha. All tests are implemented in a separate testautomation project. The REST API implementations are implemented in other projects. The Rest API is based on Swagger. So,…
GRme
  • 2,707
  • 5
  • 26
  • 49
2
votes
1 answer

Testing against multiple possible responses (API, Frisby 2)

I'm trying to write tests for a REST API that could return one of two http status codes, both of which I consider to be correct. For some reason I'm using Frisby 2, the library that's so easy, you don't even need documentation to use it! Anyway, in…
MatthewD
  • 2,509
  • 2
  • 23
  • 27
2
votes
1 answer

Validate referential integrity of object arrays with Joi

I'm trying to validate that the data I am returned it sensible. Validating data types is done. Now I want to validate that I've received all of the data needed to perform a task. Here's a representative example: { "things": [ { "id":…
Dan Caseley
  • 521
  • 6
  • 8
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 =…
1
2 3 4 5 6