We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have problem with my unit test.
Example test for reproduce problem:
const chai = require('chai'); const sinon = require('sinon'); const strftime = require('strftime'); let { expect } = chai; let sandbox = new sinon.createSandbox(); describe('strftime test', function () { afterEach(function () { sandbox.restore(); }); it('test one', () => { sandbox.useFakeTimers(new Date(2021,8,3)); expect(strftime('%Y-%m-%d %H:%M:%S')).to.be.eq('2021-09-03 00:00:00'); // ok }); it('test second, () => { sandbox.useFakeTimers(new Date(2021,8,1)); expect(strftime('%Y-%m-%d %H:%M:%S')).to.be.eq('2021-09-01 00:00:00'); // fail }); })
Problem relate with save state _cachedDateTimestamp/_cachedDate.
_cachedDateTimestamp
_cachedDate
How can I reset the state for my case?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have problem with my unit test.
Example test for reproduce problem:
Problem relate with save state
_cachedDateTimestamp
/_cachedDate
.How can I reset the state for my case?
The text was updated successfully, but these errors were encountered: