Skip to content

Commit

Permalink
test(aws-lambda-go): remove hard coded references in tests to @aws-cdk
Browse files Browse the repository at this point in the history
…packages (aws#15826)

Remove all hard coded references to the @aws-cdk/aws-lambda and @aws-cdk/aws-lambda-go packages from the tests which should fix the issue that prevent building the aws-cdk-lib package.

Resolves aws#15585


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
corymhall authored and TikiTDO committed Aug 3, 2021
1 parent 6bf181b commit b29060d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-go/test/bundling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AssetHashType, DockerImage } from '@aws-cdk/core';
import { Bundling } from '../lib/bundling';
import * as util from '../lib/util';

jest.mock('@aws-cdk/aws-lambda');
jest.spyOn(Code, 'fromAsset');
const fromAssetMock = jest.spyOn(DockerImage, 'fromBuild');
let getGoBuildVersionMock = jest.spyOn(util, 'getGoBuildVersion');

Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-lambda-go/test/function.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test('GoFunction with defaults', () => {
});

expect(Bundling.bundle).toHaveBeenCalledWith(expect.objectContaining({
entry: expect.stringMatching(/@aws-cdk\/aws-lambda-go\/test\/lambda-handler-vendor\/cmd\/api$/),
entry: expect.stringMatching(/aws-lambda-go\/test\/lambda-handler-vendor\/cmd\/api$/),
}));

expect(stack).toHaveResource('AWS::Lambda::Function', {
Expand All @@ -48,7 +48,7 @@ test('GoFunction with using provided runtime', () => {
});

expect(Bundling.bundle).toHaveBeenCalledWith(expect.objectContaining({
entry: expect.stringMatching(/@aws-cdk\/aws-lambda-go\/test\/lambda-handler-vendor\/cmd\/api$/),
entry: expect.stringMatching(/aws-lambda-go\/test\/lambda-handler-vendor\/cmd\/api$/),
}));

expect(stack).toHaveResource('AWS::Lambda::Function', {
Expand All @@ -65,7 +65,7 @@ test('GoFunction with using golang runtime', () => {
});

expect(Bundling.bundle).toHaveBeenCalledWith(expect.objectContaining({
entry: expect.stringMatching(/@aws-cdk\/aws-lambda-go\/test\/lambda-handler-vendor\/cmd\/api$/),
entry: expect.stringMatching(/aws-lambda-go\/test\/lambda-handler-vendor\/cmd\/api$/),
}));

expect(stack).toHaveResource('AWS::Lambda::Function', {
Expand Down Expand Up @@ -106,7 +106,7 @@ test('resolves entry to an absolute path', () => {
});

expect(Bundling.bundle).toHaveBeenCalledWith(expect.objectContaining({
entry: expect.stringMatching(/@aws-cdk\/aws-lambda-go\/test\/lambda-handler-vendor\/cmd\/api\/main.go$/),
entry: expect.stringMatching(/aws-lambda-go\/test\/lambda-handler-vendor\/cmd\/api\/main.go$/),
}));
});

Expand Down

0 comments on commit b29060d

Please sign in to comment.