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
new Date() instanceof Date returns false if jasmine.clock() is installed #678
Comments
What version of jasmine are you using? I just ran this spec and it's green in the current code. describe('with clock', function() {
beforeEach(function() {
jasmine.clock().install();
});
afterEach(function() {
jasmine.clock().uninstall();
});
it('can date', function() {
expect(new Date() instanceof Date).toBe(true);
});
}); |
Here is the test that fails.
I use Jasmine version 2.0.1. |
Ahh, sorry, I didn't realize you were also mocking out This looks like a bug we need to fix, so the state jasmine leaves expect(Object.prototype.toString.apply(new Date())).toEqual('[object Date]'); That should pass, and work in your code under test as well. I'll try to take a look at this at some point soon, but I'd definitely be glad to look at a pull request if you or anyone wants to give it a shot. |
Check out my pull request with the fix. Tried to follow all the contributor's cookbook rules. |
No description provided.
The text was updated successfully, but these errors were encountered: