我有以下测试,是用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();我得到的结果是:
Failures:
1) Frisby Test: Ensure we are dealing with a teapot
[ GET http://localhost:8000/isAlive ]
Message:
Expected 500 to equal 200.当我通过Postman或浏览器执行此操作时,我得到了正确的结果,即:
{
"alive": true
}此外,在测试远程端点时,它似乎可以正常工作。
我做错什么了?
发布于 2015-09-18 14:37:20
我的服务器使用以下命令在laravel的简单web服务器上运行:
php artisan serve通过运行此命令,无法从本地主机网络外部访问web服务器。
我已经使用以下命令将其更改为可以从外部访问:
php artisan serve --host 0.0.0.0希望这能帮助到某个人
https://stackoverflow.com/questions/32640769
复制相似问题