Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var CurlReporter;
- /**
- * Simple reporter that generates a curl statement
- *
- * @param {Object} newman - A run object with event handler specification methods.
- * @param {Function} newman.on - An event setter method that provides hooks for reporting collection run progress.
- * @param {Object} reporterOptions - A set of reporter specific run options.
- * @param {Object} options - A set of generic collection run options.
- * @returns {*}
- */
- CurlReporter = function (newman, reporterOptions, options) {
- if (options.silent || reporterOptions.silent) {
- return;
- }
- newman.on('start', function (err, o) {
- if (err) { return; }
- // Can start opening a file here
- });
- newman.on('beforeRequest', function (err, o) {
- if (err || !o.request) { return; }
- console.log('curl -X %s %s ', o.request.method, o.request.url.toString());
- });
- newman.on('done', function () {
- // Can closing the file here
- });
- };
- CurlReporter.prototype.dominant = true;
- module.exports = CurlReporter;
Add Comment
Please, Sign In to add comment