Created
April 11, 2018 10:25
-
-
Save vdespa/887df4af87baad916a44b749f744528d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const newman = require('newman'); | |
| newman.run({ | |
| collection: require('./postman_collection.json'), | |
| reporters: 'cli' | |
| }).on('start', function (error, args) { // on start of run, log to console | |
| console.log('Running a collection...'); | |
| }).on('request', function (error, execution) { | |
| if (error) { | |
| console.error('collection run encountered an error.'); | |
| console.error(error); | |
| } | |
| else { | |
| console.log(execution.response.stream.toString()); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment