diff --git a/lib/commands/deploy_api.js b/lib/commands/deploy_api.js index d340cddb6..8702c335e 100644 --- a/lib/commands/deploy_api.js +++ b/lib/commands/deploy_api.js @@ -7,7 +7,6 @@ // TODO: figure out what specific permissions are needed // TODO: Add Concurrent API creation across multiple regions, currently consecutive -// TODO: Add restApiId's to regions in jaws.json "project" after creation var JawsError = require('../jaws-error'), Promise = require('bluebird'), @@ -113,7 +112,7 @@ ApiDeployer.prototype._validateAndSantizeTaggedEndpoints = Promise.method(functi var _this = this; // Loop through tagged endpoints - for (var i = 0;i < _this._endpoints.length;i++) { + for (var i = 0; i < _this._endpoints.length; i++) { var e = _this._endpoints[i].endpoint; @@ -144,7 +143,7 @@ ApiDeployer.prototype._saveApiId = Promise.method(function() { var _this = this; // Attach API Gateway REST API ID - for(var i = 0; i < _this._prjJson.project.stages[_this._stage].length; i++) { + for (var i = 0; i < _this._prjJson.project.stages[_this._stage].length; i++) { if (_this._prjJson.project.stages[_this._stage][i].region === _this._region.region) { _this._prjJson.project.stages[_this._stage][i].restApiId = _this._restApiId; } @@ -346,6 +345,7 @@ ApiDeployer.prototype._createEndpointMethod = Promise.method(function(endpoint) endpoint.endpoint.apig.resource.id, endpoint.endpoint.method) .then(function() { + return _this.ApiClient.deleteMethod( _this._restApiId, endpoint.endpoint.apig.resource.id, @@ -358,6 +358,7 @@ ApiDeployer.prototype._createEndpointMethod = Promise.method(function(endpoint) methodBody); }); }, function() { + return _this.ApiClient.putMethod( _this._restApiId, endpoint.endpoint.apig.resource.id, diff --git a/tests/all.js b/tests/all.js index a8d05dc7b..2ec03cd6c 100644 --- a/tests/all.js +++ b/tests/all.js @@ -14,15 +14,15 @@ describe('AllTests', function() { }); //require tests vs inline so we can run sequentially - //require('./cli/tag'); - //require('./cli/install'); - //require('./cli/env'); - //require('./cli/generate'); + require('./cli/tag'); + require('./cli/install'); + require('./cli/env'); + require('./cli/generate'); /** * Tests below create AWS Resources */ //require('./cli/deploy_lambda'); - require('./cli/deploy_api'); + //require('./cli/deploy_api'); //require('./cli/new'); //Must be run last });