diff --git a/README.md b/README.md index 4967ce6e7..f5d6bed48 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -Newman [![Build Status](https://travis-ci.org/a85/Newman.svg?branch=master)](https://travis-ci.org/a85/Newman) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/) -====== +# Newman [![Build Status](https://travis-ci.org/a85/Newman.svg?branch=master)](https://travis-ci.org/a85/Newman) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/) +[![NPM](https://nodei.co/npm/newman.png?downloads=true)](https://nodei.co/npm-dl/newman/) Newman is a command-line collection runner for [Postman](http://getpostman.com). It allows you to effortlessly run and test a Postman collection directly from the command-line. It is built with extensibility in mind so that you can easily integrate it with your continuous integration servers and build systems. diff --git a/src/utilities/ResponseExporter.js b/src/utilities/ResponseExporter.js index 916ecf820..e5b7fcd85 100644 --- a/src/utilities/ResponseExporter.js +++ b/src/utilities/ResponseExporter.js @@ -84,9 +84,8 @@ var ResponseExporter = jsface.Class({ * @memberOf ResponseExporter */ exportResults: function() { - var exportVariable = this._createExportVariable(); - if (Globals.outputFile) { + var exportVariable = this._createExportVariable(); var filepath = path.resolve(Globals.outputFile); fs.writeFileSync(filepath , JSON.stringify(exportVariable, null, 4)); log.note("\n\n Output Log: " + filepath + "\n"); diff --git a/tests/runners/IterationRunner.js b/tests/runners/IterationRunner.js index ce7b60671..d43cea2e2 100644 --- a/tests/runners/IterationRunner.js +++ b/tests/runners/IterationRunner.js @@ -20,26 +20,23 @@ describe("IterationRunner", function() { var filePath = path.join(__dirname, '../', 'data', 'PostmanCollection.json'); var url = "https://www.getpostman.com/collections/fc3f0598daaa5271e4f7"; var options = {iterationCount: 2}; - this.emitter = new Emitter(); - this.collectionJson = JSON5.parse(fs.readFileSync(filePath, 'utf8')); - - this.emitter.removeAllListeners(); - - this.iterationRunner = new IterationRunner(this.collectionJson, options); - this.spy = sinon.spy(this.iterationRunner, '_runNextIteration'); - - sinon.stub(RequestRunner, '_execute'); + var emitter = new Emitter(); + var collectionJson = JSON5.parse(fs.readFileSync(filePath, 'utf8')); + emitter.removeAllListeners(); + this.iterationRunner = new IterationRunner(collectionJson, options); + sinon.stub(this.iterationRunner, '_logStatus'); + sinon.stub(this.iterationRunner, '_runCollection', function() { + emitter.emit('collectionRunnerOver'); + }); }); it("should call nextIteration for every itertion", function() { - this.iterationRunner._runCollection = function() { - //this.emitter.emit('collectionRunnerOver'); - }.bind(this); - - //this.iterationRunner.execute(); + this.iterationRunner.execute(); + assert(this.iterationRunner.iteration, 2); }); afterEach(function() { - this.iterationRunner._runNextIteration.restore(); + this.iterationRunner._logStatus.restore(); + this.iterationRunner._runCollection.restore(); }); });