cdklabs / cdklabs/cdk-docker-image-deployment

Snapshot test always fails even when no changes are made

Open
#635 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
88
Forks
15
Avg merge
7m
Merged PRs (30d)
30

Description

### Expected behavior

The npm test command successfully completes a snapshot test.

### Actual behavior

I have a project with `cdk-docker-image-deployment` v0.0.577 and am trying to implement a snapshot test like [this](https://github.com/kdnakt/cdk-dockerimage-deploy-test/blob/main/test/cdk-test1.test.ts) using a stack like the one below:

```
export class CdkTest1Stack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);

const repo = ecr.Repository.fromRepositoryName(this, 'MyRepository', 'myrepository');

new imagedeploy.DockerImageDeployment(this, 'ExampleImageDeploymentWithTag', {
source: imagedeploy.Source.directory('./docker'),
destination: imagedeploy.Destination.ecr(repo, {
tag: 'myspecialtag',
}),
});
}
}
```

However, when I execute `npm test` right after executing `npm test -u`, it always fails with the following output.

image

Contributor guide

Open the contributing guide

Research direction

Start with the linked test/cdk-test1.test.ts example and reproduce the behavior by running npm test -u followed by npm test. Compare the generated snapshot and failure output to determine why an unchanged snapshot is treated as different; done means npm test succeeds without further updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.