December 2018
Intermediate to advanced
642 pages
15h 5m
English
By using the newman package (install it with npm install newman --save-dev), you can run your Postman tests from the command line, which could also allow you to include them in a continuous integration workflow. First, export your collection from Postman (uninspiredly, I called mine postman_collection.json), and then add a new script to your package.json file called "newman":"newman run postman_collection.json". Using npm run newman will then produce an output like the one shown in the following code snippet. You could also test whether all of the tests ran satisfactorily or whether there was a problem:
> npm run newman> simpleproject@1.0.0 newman /home/fkereki/MODERNJS/chapter05> newman run postman_collection.jsonnewmanRead now
Unlock full access