mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
73 lines
1.6 KiB
JavaScript
73 lines
1.6 KiB
JavaScript
'use strict';
|
|
|
|
/**
|
|
* JAWS Test: Dash Command
|
|
*/
|
|
|
|
var Jaws = require('../../lib/index.js'),
|
|
CMDdash = require('../../lib/commands/dash'),
|
|
CMDtag = require('../../lib/commands/tag'),
|
|
JawsError = require('../../lib/jaws-error'),
|
|
testUtils = require('../test_utils'),
|
|
Promise = require('bluebird'),
|
|
path = require('path'),
|
|
assert = require('chai').assert;
|
|
|
|
var config = require('../config'),
|
|
projPath,
|
|
JAWS;
|
|
|
|
describe('Test "dash" command', function() {
|
|
|
|
before(function(done) {
|
|
this.timeout(0);
|
|
|
|
// Tag All Lambdas & Endpoints
|
|
return Promise.try(function() {
|
|
|
|
// Create Test Project
|
|
projPath = testUtils.createTestProject(
|
|
config.name,
|
|
config.region,
|
|
config.stage,
|
|
config.iamRoleArnLambda,
|
|
config.iamRoleArnApiGateway,
|
|
config.envBucket,
|
|
['back']);
|
|
process.chdir(path.join(projPath, 'back'));
|
|
|
|
// Instantiate JAWS
|
|
JAWS = new Jaws();
|
|
})
|
|
.then(function() {
|
|
return CMDtag.tagAll(JAWS, 'lambda');
|
|
})
|
|
.then(function() {
|
|
return CMDtag.tagAll(JAWS, 'endpoint');
|
|
})
|
|
.then(function() {
|
|
return done();
|
|
});
|
|
});
|
|
|
|
after(function(done) {
|
|
done();
|
|
});
|
|
|
|
describe('Positive tests', function() {
|
|
it('Dash deployment via tagged resources', function(done) {
|
|
this.timeout(0);
|
|
|
|
CMDdash.run(JAWS, config.stage, [config.region], true)
|
|
.then(function() {
|
|
done();
|
|
})
|
|
.catch(JawsError, function(e) {
|
|
done(e);
|
|
})
|
|
.error(function(e) {
|
|
done(e);
|
|
});
|
|
});
|
|
});
|
|
}); |