如何在节点js中为请求编写一个茉莉花单元测试用例

时间:2018-10-07 15:29:11

标签: node.js npm jasmine

我是茉莉的新手,我没有获得任何资源来编写我在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
    });
});

如何为上述代码编写一个茉莉花单元测试用例?

0 个答案:

没有答案