尝试制作 MULTIPLE 模拟服务响应 500 以测试任何建议?
1 回答
2
Miragejs 有一个Response 类,您可以将其实例化并从您的响应处理程序返回。构造函数中的第一个参数是状态:
import { Response } from 'miragejs';
this.get('/users', () => {
return new Response(500, { some: 'header' }, { errors: [ 'name cannot be blank'] });
});
于 2021-08-07T15:49:28.480 回答