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

chore: testing pr linter codecov exemptions #32866

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 0 additions & 94 deletions packages/aws-cdk/test/assets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,100 +24,6 @@ afterEach(() => {
toolkitMock.dispose();
});

describe('file assets', () => {
test('convert to manifest and parameters', async () => {
// GIVEN
const ext = __filename.match(/\.([tj]s)$/)?.[1];
const stack = stackWithAssets([
{
sourceHash: 'source-hash',
path: __filename,
id: 'SomeStackSomeResource4567',
packaging: 'file',
s3BucketParameter: 'BucketParameter',
s3KeyParameter: 'KeyParameter',
artifactHashParameter: 'ArtifactHashParameter',
},
]);

// WHEN
const params = await addMetadataAssetsToManifest(stack, assets, envResources);

// THEN
expect(params).toEqual({
BucketParameter: 'MockToolkitBucketName',
KeyParameter: `assets/SomeStackSomeResource4567/||source-hash.${ext}`,
ArtifactHashParameter: 'source-hash',
});

expect(assets.toManifest('.').entries).toEqual([
expect.objectContaining({
destination: {
bucketName: 'MockToolkitBucketName',
objectKey: `assets/SomeStackSomeResource4567/source-hash.${ext}`,
},
source: {
packaging: 'file',
path: __filename,
},
}),
]);
});

test('hash and ID the same => only one path component', async () => {
// GIVEN
const ext = __filename.match(/\.([tj]s)$/)?.[1];
const stack = stackWithAssets([
{
sourceHash: 'source-hash',
path: __filename,
id: 'source-hash',
packaging: 'file',
s3BucketParameter: 'BucketParameter',
s3KeyParameter: 'KeyParameter',
artifactHashParameter: 'ArtifactHashParameter',
},
]);

// WHEN
await addMetadataAssetsToManifest(stack, assets, envResources);

// THEN
expect(assets.toManifest('.').entries).toEqual([
expect.objectContaining({
destination: {
bucketName: 'MockToolkitBucketName',
objectKey: `assets/source-hash.${ext}`,
},
}),
]);
});

test('reuse', async () => {
// GIVEN
const stack = stackWithAssets([
{
path: __filename,
id: 'SomeStackSomeResource4567',
packaging: 'file',
s3BucketParameter: 'BucketParameter',
s3KeyParameter: 'KeyParameter',
artifactHashParameter: 'ArtifactHashParameter',
sourceHash: 'boom',
},
]);

// WHEN
const params = await addMetadataAssetsToManifest(stack, assets, envResources, ['SomeStackSomeResource4567']);

// THEN
expect(params).toEqual({
});

expect(assets.toManifest('.').entries).toEqual([]);
});
});

describe('docker assets', () => {
test('parameter and no repository name (old)', async () => {
await withMocked(envResources, 'prepareEcrRepository', async () => {
Expand Down
Loading