"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var stream = tslib_1.__importStar(require("stream"));
var qs = tslib_1.__importStar(require("qs"));
var consts_1 = require("src/consts");
exports.Request = {
    headers: (_a = {},
        _a[consts_1.X_SM_BASEPATH] = '/sm/api',
        _a[consts_1.X_SM_PATH] = '/test',
        _a),
    method: 'get',
    url: '/sm/api/test?t=200'
};
exports.Response = {};
exports.mockReadable = function () {
    var e = new stream.Writable({
        write: function (chunk, encoding, callback) {
            callback();
        }
    });
    return e;
};
// @cc: no number in form
exports.testJSON = { id: '2', name: 'yqj' };
exports.mockRequest = function (headers) {
    var steam = exports.mockReadable();
    var req = steam;
    req.headers = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, req.headers), exports.Request.headers), headers);
    setTimeout(function () {
        req.emit('data', headers['content-type'] && headers['content-type'].match('json')
            ? JSON.stringify(exports.testJSON)
            : qs.stringify(exports.testJSON));
        req.emit('end');
        req.destroy();
    }, 14);
    return req;
};
//# sourceMappingURL=consts.js.map