feat: ✨ Created a mini nodeJS server with NewMan for testing without PostMan GUI.
This will mimic a run in a CD/CI environment or docker container.
This commit is contained in:
22
node_modules/newman/lib/reporters/json/index.js
generated
vendored
Normal file
22
node_modules/newman/lib/reporters/json/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
var _ = require('lodash');
|
||||
|
||||
/**
|
||||
* Reporter that simply dumps the summary object to file (default: newman-run-report.json).
|
||||
*
|
||||
* @param {Object} newman - The collection run object, with event hooks for reporting run details.
|
||||
* @param {Object} options - A set of collection run options.
|
||||
* @param {String} options.export - The path to which the summary object must be written.
|
||||
* @returns {*}
|
||||
*/
|
||||
module.exports = function (newman, options) {
|
||||
newman.on('beforeDone', function (err, o) {
|
||||
if (err) { return; }
|
||||
|
||||
newman.exports.push({
|
||||
name: 'json-reporter',
|
||||
default: 'newman-run-report.json',
|
||||
path: options.export,
|
||||
content: JSON.stringify(_.omit(o.summary, 'exports'), 0, 2)
|
||||
});
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user