Skip to content

Commit

Permalink
fixed unit tests with new naming
Browse files Browse the repository at this point in the history
Signed-off-by: Francis <colifran@amazon.com>
  • Loading branch information
colifran committed Dec 14, 2023
1 parent cf435a0 commit 4d25941
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export abstract class HandlerFrameworkClass extends ClassType {
},
};
const _interface = this.getOrCreateInterface(scope, {
name: 'CdkSingletonFunctionProps',
name: `${this.name}Props`,
export: true,
extends: [LAMBDA_MODULE.FunctionOptions],
properties: [uuid, lambdaPurpose],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as path from "path";
import { Construct } from "constructs";
import * as lambda from "../../../aws-lambda";

export class TestProvider extends lambda.Function {
export class TestFunction extends lambda.Function {
public constructor(scope: Construct, id: string, props?: lambda.FunctionOptions) {
super(scope, id, {
...props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as path from "path";
import { Construct } from "constructs";
import * as lambda from "../../../aws-lambda";

export class TestProvider extends lambda.SingletonFunction {
export class TestSingletonFunction extends lambda.SingletonFunction {
public constructor(scope: Construct, id: string, props: CdkSingletonFunctionProps) {
super(scope, id, {
...props,
Expand All @@ -15,9 +15,9 @@ export class TestProvider extends lambda.SingletonFunction {
}

/**
* Initialization properties for TestProvider
* Initialization properties for TestSingletonFunction
*/
export interface CdkSingletonFunctionProps extends lambda.FunctionOptions {
export interface TestSingletonFunctionProps extends lambda.FunctionOptions {
/**
* A unique identifier to identify this Lambda.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('framework', () => {

// THEN
const result = fs.readFileSync(path.resolve(tmpDir, 'result.ts'), 'utf-8');
const expected = fs.readFileSync(path.resolve(__dirname, 'expected', 'cdk-function.ts'), 'utf-8');
const expected = fs.readFileSync(path.resolve(__dirname, 'expected', 'function.ts'), 'utf-8');
expect(result).toContain(expected);
});

Expand All @@ -49,7 +49,7 @@ describe('framework', () => {

// THEN
const result = fs.readFileSync(path.resolve(tmpDir, 'result.ts'), 'utf-8');
const expected = fs.readFileSync(path.resolve(__dirname, 'expected', 'cdk-singleton-function.ts'), 'utf-8');
const expected = fs.readFileSync(path.resolve(__dirname, 'expected', 'singleton-function.ts'), 'utf-8');
expect(result).toContain(expected);
});

Expand All @@ -68,7 +68,7 @@ describe('framework', () => {

// THEN
const result = fs.readFileSync(path.resolve(tmpDir, 'result.ts'), 'utf-8');
const expected = fs.readFileSync(path.resolve(__dirname, 'expected', 'cdk-custom-resource-provider.ts'), 'utf-8');
const expected = fs.readFileSync(path.resolve(__dirname, 'expected', 'custom-resource-provider.ts'), 'utf-8');
expect(result).toContain(expected);
});

Expand All @@ -87,7 +87,7 @@ describe('framework', () => {

// THEN
const result = fs.readFileSync(path.resolve(tmpDir, 'result.ts'), 'utf-8');
const expected = fs.readFileSync(path.resolve(__dirname, 'expected', 'cdk-custom-resource-provider-core.ts'), 'utf-8');
const expected = fs.readFileSync(path.resolve(__dirname, 'expected', 'custom-resource-provider-core.ts'), 'utf-8');
expect(result).toContain(expected);
});
});

0 comments on commit 4d25941

Please sign in to comment.