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

Allow mocking time #15

Open
colemickens opened this issue Dec 6, 2018 · 5 comments
Open

Allow mocking time #15

colemickens opened this issue Dec 6, 2018 · 5 comments

Comments

@colemickens
Copy link

When I looked, it didn't seem like it was possible to mock the various usages of time.Now making it hard to do nice testing around this library.

Thanks!

kisom added a commit that referenced this issue Dec 6, 2018
This addresses #15.
@kisom
Copy link
Member

kisom commented Dec 6, 2018

Thanks, @colemickens. I've got a PR open to support mocking the clock.

kisom added a commit that referenced this issue Dec 7, 2018
This addresses #15.
@kisom kisom closed this as completed Dec 7, 2018
@colemickens
Copy link
Author

Thank you, especially for the very fast turnaround. Cheers!

@colemickens
Copy link
Author

Actually, I don't really understand how this is usable. It's not exported and there's no setter functionality. I think this should be reopened.

@kisom
Copy link
Member

kisom commented Dec 10, 2018

I misunderstood - you want to be able to test this from an external package. I've included support for that now in #17.

@dominikschulz
Copy link

Also this change seems to break TOTP. AFAIK the clock needs to be initialised.

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

3 participants