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

Testcase is intially written, but fails on updating the test #30

Closed
markussiebert opened this issue Apr 10, 2022 · 3 comments
Closed

Testcase is intially written, but fails on updating the test #30

markussiebert opened this issue Apr 10, 2022 · 3 comments

Comments

@markussiebert
Copy link

Hi,

if I create the test case, everything is fine... if I update it, it is updated in a wrong way so that from this point on all tests will fail. It only is possible to fix if I delete the snaps and create them from scratch...

--- FAIL: Test_UpdateSecret (0.00s)
    mocks.go:24: 
         Snapshot 
         Received 
        
        >>>SecretsManagerMockClient.PutSecretValue.Input
        {
          ClientRequestToken: "4547532a137611d83958d17095c6c2d38ae0036a760c3b79c9dd5957d1c20cf2.yaml",
          SecretId: "arn:${Partition}:secretsmanager:::secret:${Region}:${Account}:secret:${SecretId}",
          SecretString: <sensitive>
        }

image

Do you need more information?

@gkampitakis
Copy link
Owner

Hello 👋 , could you give me some more information and/or a way to reproduce it ? This looks weird and can't think of a reason on top of my head why this might be happening

@gkampitakis
Copy link
Owner

Okay had a look at your snapshot. The issue is the special ${} chars and a method in a regex I use that I was not aware of.

I should be using ReplaceAllLiteralString instead of ReplaceAllString.

I believe you have found all the edge cases, sorry and thank you for that, I use this library but not so heavily so I haven't found all those issues 😓

Going to create a pr and release a "fix" version for this.

@gkampitakis
Copy link
Owner

Going to release now a new version with the fix, if the issue persists feel free to reopen it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants