Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ecr): lookup existing repository #33662

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
fix import order
  • Loading branch information
badmintoncryer committed Mar 3, 2025
commit 473f690b5e3db340070dc66abe32338addf2bc5c
8 changes: 3 additions & 5 deletions packages/aws-cdk-lib/aws-ecr/test/repository.test.ts
Original file line number Diff line number Diff line change
@@ -2,11 +2,9 @@ import { EOL } from 'os';
import { Annotations, Template } from '../../assertions';
import * as iam from '../../aws-iam';
import * as kms from '../../aws-kms';
import * as cdk from '../../core';
import * as cxschema from '../../cloud-assembly-schema';
import * as cdk from '../../core';
import * as ecr from '../lib';
import { ContextProvider } from '../../core';

/* eslint-disable quote-props */

describe('repository', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a test case to check if provided ECR repo (name or ARN) does not exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

@@ -21,7 +19,7 @@ describe('repository', () => {
const value = {
value: resultObjs,
};
const mock = jest.spyOn(ContextProvider, 'getValue').mockReturnValue(value);
const mock = jest.spyOn(cdk.ContextProvider, 'getValue').mockReturnValue(value);

// WHEN
const stack = new cdk.Stack(undefined, undefined, { env: { region: 'us-east-1', account: '123456789012' } });
@@ -62,7 +60,7 @@ describe('repository', () => {
const value = {
value: resultObjs,
};
const mock = jest.spyOn(ContextProvider, 'getValue').mockReturnValue(value);
const mock = jest.spyOn(cdk.ContextProvider, 'getValue').mockReturnValue(value);

// WHEN
const stack = new cdk.Stack(undefined, undefined, { env: { region: 'us-east-1', account: '123456789012' } });
Loading
Oops, something went wrong.