mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
52 lines
1.1 KiB
JavaScript
52 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
/**
|
|
* JAWS Test: Deploy API Command
|
|
* - Copies the test-prj template to your system's temp directory
|
|
* - Deploys an API based on the endpoints in the project
|
|
*/
|
|
var testUtils = require('../test_utils'),
|
|
path = require('path'),
|
|
assert = require('chai').assert;
|
|
|
|
var config = require('../config');
|
|
|
|
describe('Test deploy api command', function() {
|
|
|
|
before(function() {
|
|
config.projectPath = testUtils.createTestProject(
|
|
config.name,
|
|
config.region,
|
|
config.stage,
|
|
config.iamRoleARN,
|
|
config.envBucket);
|
|
process.chdir(config.projectPath);
|
|
});
|
|
|
|
after(function(done) {
|
|
done();
|
|
});
|
|
|
|
describe('Positive tests', function() {
|
|
it('Deploy REST API', function(done) {
|
|
|
|
this.timeout(0);
|
|
|
|
// Require
|
|
var JAWS = require('../../lib/index.js'),
|
|
JawsError = require('../../lib/jaws-error');
|
|
|
|
// Test
|
|
JAWS.deployApi(config.stage)
|
|
.then(function() {
|
|
done();
|
|
})
|
|
.catch(JawsError, function(e) {
|
|
done(e);
|
|
})
|
|
.error(function(e) {
|
|
done(e);
|
|
});
|
|
});
|
|
});
|
|
}); |