Skip to content

Commit

Permalink
test: Optimize test configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Dec 6, 2019
1 parent 3f3afa2 commit a2e3939
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions tests/integration-all/api-gateway/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,7 @@ describe('AWS - API Gateway Integration Test', function() {
stackName = `${serviceName}-${stage}`;
console.info(`Deploying "${stackName}" service...`);
await deployService(tmpDirPath);
});

after(async () => {
console.info('Removing service...');
await removeService(tmpDirPath);
});

beforeEach(() => {
return CF.describeStacks({ StackName: stackName })
CF.describeStacks({ StackName: stackName })
.promise()
.then(
result => _.find(result.Stacks[0].Outputs, { OutputKey: 'ServiceEndpoint' }).OutputValue
Expand All @@ -65,6 +57,11 @@ describe('AWS - API Gateway Integration Test', function() {
});
});

after(async () => {
console.info('Removing service...');
await removeService(tmpDirPath);
});

describe('Minimal Setup', () => {
const expectedMessage = 'Hello from API Gateway! - (minimal)';

Expand Down Expand Up @@ -147,7 +144,7 @@ describe('AWS - API Gateway Integration Test', function() {
describe('Custom Authorizers', () => {
let testEndpoint;

beforeEach(() => {
before(() => {
testEndpoint = `${endpoint}/custom-auth`;
});

Expand Down Expand Up @@ -179,7 +176,7 @@ describe('AWS - API Gateway Integration Test', function() {
describe('API Keys', () => {
let testEndpoint;

beforeEach(() => {
before(() => {
testEndpoint = `${endpoint}/api-keys`;
});

Expand Down

0 comments on commit a2e3939

Please sign in to comment.