3

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'
    }
};

frisby.create('Ensure we are dealing with a teapot')
    .get(CONSTS.server + '/isAlive', {headers: CONSTS.headers}, {json: true})
    .timeout(10000)
    .expectStatus(200)
    .toss();

I am getting this result:

Failures:

  1) Frisby Test: Ensure we are dealing with a teapot 
        [ GET http://localhost:8000/isAlive ]
   Message:
     Expected 500 to equal 200.

When I am executing this via Postman or through the browser I am getting the correct result, which is:

{
    "alive": true
}

Also, when testing remote endpoints it seems to be working.
What did I do wrong?

vlio20
  • 8,955
  • 18
  • 95
  • 180
  • Do you have debugging on the server-side to figure out what the internal server error was? – Kevin B Sep 17 '15 at 22:19
  • I don't see that signature for `get` anywhere in the documentation you posted. Are you sure you it takes headers like that? – azium Sep 17 '15 at 22:21

1 Answers1

0

My server is running on the laravel's simple web server with the following command:

php artisan serve

By running this, the web server is not accessible from outside the localhost network.
I have changed it to be accessible from outside with the following command:

php artisan serve --host 0.0.0.0

Hope it helps someone

vlio20
  • 8,955
  • 18
  • 95
  • 180