In ember, I'm writing acceptance test for a template using pretender as mock server.
var server = new Pretender();
server.get('/events', JSON.stringify(200, {
events: [
{
event_id: '23456789098765',
event_time: '2017-02-01',
event_time_formatted: '01/02/2017 06:24 AM',
event_type: 'renewed'
}
]
}));
When I run the ember test I'm getting "Unable to connect to server. Please check your network connection." error!
Can anybody tell why this happening?
It seems that by letting Pretender intercept all requests unconditionally, you broke something.
Instead, use Mirage . It has Pretender preconfigured and offers a slimmer API, complete with primitives for building a full-fledged mock server.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.