我是茉莉的新手,我没有获得任何资源来编写我在Node.js 10.11.0v中编写的代码的测试用例
我的代码:
request(url, {
rejectUnauthorized: false
}, function (err, res, body) {
if (err || res.statusCode !== 200)
_logThenThrow(err, 'Non 200 response received from request to: ' + url);
logger.log('Request returned 200 response. Now parsing it...');
var mappings = parser.toJson(body);
next({
groupMappings: mappings
});
});
如何为上述代码编写一个茉莉花单元测试用例?