【发布时间】:2020-12-17 01:29:35
【问题描述】:
我正在执行集成测试,我有一个场景,我必须在表单数据中提供字段。我可以在 .attach 中提供一个密钥和文件。在我的情况下,我必须在同一个请求中提供表单数据中的五个键和值。如何实现?
我已经完成的示例代码。
const response = await request(server)
.post('url for the request')
.set({
'Content-Type': 'application/json',
})
.attach('key', 'file');
【问题讨论】:
标签: javascript node.js jestjs supertest