Skip to content

Commit

Permalink
fix: lint, unit test, API.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyu99 committed Jul 31, 2024
1 parent edf400e commit 2b7e9e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions packages/amplify-graphql-model-transformer/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ export const getSsmEndpoint: (scope: Construct, resourceNames: SQLLambdaResource
// @public (undocumented)
export const getSubscriptionFilterInputName: (name: string) => string;

// @public (undocumented)
export const isSandboxDeployment: (context: TransformerContextProvider) => context is TransformerContextProvider & {
deploymentIdentifier: {
deploymentType: 'sandbox';
};
};

// @public (undocumented)
export function makeAttributeTypeEnum(): EnumTypeDefinitionNode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('CustomResources', () => {
const createProperties = JSON.parse(customResource.Properties.Create['Fn::Join'][1].join(''));
const updateProperties = JSON.parse(customResource.Properties.Update['Fn::Join'][1].join(''));

const expectedPhysicalId = `TestLayerVersionCustomResource-${new Date().toISOString().substring(0, 10)}`;
const expectedPhysicalId = 'TestLayerVersionCustomResource';
expect(createProperties.physicalResourceId.id).toEqual(expectedPhysicalId);
expect(updateProperties.physicalResourceId.id).toEqual(expectedPhysicalId);
});
Expand All @@ -67,7 +67,7 @@ describe('CustomResources', () => {
const createProperties = JSON.parse(customResource.Properties.Create['Fn::Join'][1].join(''));
const updateProperties = JSON.parse(customResource.Properties.Update['Fn::Join'][1].join(''));

const expectedPhysicalId = `TestSNSTopicARNCustomResource-${new Date().toISOString().substring(0, 10)}`;
const expectedPhysicalId = 'TestSNSTopicARNCustomResource';
expect(createProperties.physicalResourceId.id).toEqual(expectedPhysicalId);
expect(updateProperties.physicalResourceId.id).toEqual(expectedPhysicalId);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export const createSNSTopicARNCustomResource = (

// Type predicate to check if the deployment type is 'sandbox'
export const isSandboxDeployment = (
context: TransformerContextProvider
context: TransformerContextProvider,
): context is TransformerContextProvider & { deploymentIdentifier: { deploymentType: 'sandbox' } } => {
return context?.synthParameters?.deploymentIdentifier?.deploymentType === 'sandbox';
};
Expand Down

0 comments on commit 2b7e9e8

Please sign in to comment.