gkampitakis / go-snaps

Jest-like snapshot testing in Go 📸
https://pkg.go.dev/github.com/gkampitakis/go-snaps
MIT License
158 stars 6 forks source link

Behaviour changed? Secrets now redacted? #28

Closed markussiebert closed 2 years ago

markussiebert commented 2 years ago

Hi,

did you changed something regarding secret values? My tests change from

[Test_UpdateSecret - 1]
>>>SecretsManagerMockClient.PutSecretValue.Input
{
  ClientRequestToken: "4547532a137611d83958d17095c6c2d38ae0036a760c3b79c9dd5957d1c20cf2",
  SecretId: "arn:${Partition}:secretsmanager:${Region}:${Account}:secret:${SecretId}",
  SecretString: "some-secret-data"
}

to

[Test_UpdateSecret - 1]
>>>SecretsManagerMockClient.PutSecretValue.Input
{
  ClientRequestToken: "4547532a137611d83958d17095c6c2d38ae0036a760c3b79c9dd5957d1c20cf2",
  SecretId: "arn::secretsmanager:::secret:",
  SecretString: <sensitive>
}

Can I disable the replacing with ? I think no one stores real secrets in tests...

gkampitakis commented 2 years ago

Hey :wave:, no I have not changed anything in the library regarding secrets. The library doesn't have any idea of what data are stored in the snaps. The only change was around escaping --- those "special characters".

markussiebert commented 2 years ago

Thank you a lot :-)