Skip to content

Commit

Permalink
drop unneeded tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Niranjan Jayakar committed Apr 24, 2020
1 parent 95e059c commit df94e63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 69 deletions.
35 changes: 1 addition & 34 deletions packages/@aws-cdk/aws-apigateway/test/authorizers/test.lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as iam from '@aws-cdk/aws-iam';
import * as lambda from '@aws-cdk/aws-lambda';
import { Duration, Stack } from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { AuthorizationType, Authorizer, IdentitySource, RequestAuthorizer, RestApi, TokenAuthorizer } from '../../lib';
import { AuthorizationType, IdentitySource, RequestAuthorizer, RestApi, TokenAuthorizer } from '../../lib';

export = {
'default token authorizer'(test: Test) {
Expand Down Expand Up @@ -301,37 +301,4 @@ export = {

test.done();
},

'token authorizer is of type Authorizer'(test: Test) {
const stack = new Stack();

const handler = new lambda.Function(stack, 'token', {
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_12_X,
handler: 'index.handler',
});
const authorizer = new TokenAuthorizer(stack, 'authorizer', { handler });

test.ok(Authorizer.isAuthorizer(authorizer), 'TokenAuthorizer is not of type Authorizer');

test.done();
},

'request authorizer is of type Authorizer'(test: Test) {
const stack = new Stack();

const handler = new lambda.Function(stack, 'token', {
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_12_X,
handler: 'index.handler',
});
const authorizer = new RequestAuthorizer(stack, 'authorizer', {
handler,
identitySources: [ IdentitySource.header('my-header') ],
});

test.ok(Authorizer.isAuthorizer(authorizer), 'RequestAuthorizer is not of type Authorizer');

test.done();
},
};
36 changes: 1 addition & 35 deletions packages/@aws-cdk/aws-apigateway/test/test.authorizer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Code, Function, Runtime } from '@aws-cdk/aws-lambda';
import { Stack } from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { Authorizer, IdentitySource, RequestAuthorizer, RestApi, TokenAuthorizer } from '../lib';
import { Authorizer, RestApi } from '../lib';

export = {
'isAuthorizer correctly detects an instance of type Authorizer'(test: Test) {
Expand All @@ -19,37 +18,4 @@ export = {

test.done();
},

'token authorizer is of type Authorizer'(test: Test) {
const stack = new Stack();

const handler = new Function(stack, 'token', {
code: Code.fromInline('foo'),
runtime: Runtime.NODEJS_12_X,
handler: 'index.handler',
});
const authorizer = new TokenAuthorizer(stack, 'authorizer', { handler });

test.ok(Authorizer.isAuthorizer(authorizer), 'TokenAuthorizer is not of type Authorizer');

test.done();
},

'request authorizer is of type Authorizer'(test: Test) {
const stack = new Stack();

const handler = new Function(stack, 'token', {
code: Code.fromInline('foo'),
runtime: Runtime.NODEJS_12_X,
handler: 'index.handler',
});
const authorizer = new RequestAuthorizer(stack, 'authorizer', {
handler,
identitySources: [ IdentitySource.header('my-header') ],
});

test.ok(Authorizer.isAuthorizer(authorizer), 'RequestAuthorizer is not of type Authorizer');

test.done();
},
};

0 comments on commit df94e63

Please sign in to comment.