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

Update cupaloy.go #43

Merged
merged 3 commits into from
Sep 20, 2018
Merged

Update cupaloy.go #43

merged 3 commits into from
Sep 20, 2018

Conversation

byang223
Copy link
Contributor

cupaloy.Global = cupaloy.Global.WithOptions(
		cupaloy.CreateNewAutomatically(false),
		cupaloy.EnvVariableName(updateSnapshotsEnv),
		cupaloy.FailOnUpdate(false),
		cupaloy.ShouldUpdate(func() bool { return updateSnapshot}),
		cupaloy.SnapshotSubdirectory(updateSnapshotsDir),
	)

Sorry missed this earlier. This is the set of config I'm using. When snapshots don't exist and I'm running in bazel setting it is not failing as expected.

```
cupaloy.Global = cupaloy.Global.WithOptions(
		cupaloy.CreateNewAutomatically(false),
		cupaloy.EnvVariableName(updateSnapshotsEnv),
		cupaloy.FailOnUpdate(false),
		cupaloy.ShouldUpdate(func() bool { return updateSnapshot}),
		cupaloy.SnapshotSubdirectory(updateSnapshotsDir),
	)
```

Sorry missed this earlier. This is the set of config I'm using. When snapshots don't exist and I'm running in bazel setting it is not failing as expected.
@byang223
Copy link
Contributor Author

Sorry don't have too much experience on Github/Pull Requests, would probably be better if you could commandeer this small edit.

@bradleyjkemp
Copy link
Owner

Ouch, nice catch. I think you just need two small changes to TestGlobalCreateNewAutomatically in order to make the tests pass:

  • Change mockT.AssertNotCalled(t, "Error") to mockT.AssertCalled(t, "Error") (wow that's an unfortunate typo...)
  • Add mockT.On("Error", mock.Anything).Return() to the list of other mocked methods

If you want to do that then I'm happy to merge this. Or if not then I can do it, just let me know :)

@byang223
Copy link
Contributor Author

updated the tests

Copy link
Owner

@bradleyjkemp bradleyjkemp left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for catching this!

@bradleyjkemp bradleyjkemp merged commit 5859e8d into bradleyjkemp:master Sep 20, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants