I use moment.js for the date / time in my application, but it does not seem to play well with the mocking capabilities of Jasmine. I put together a test suite below that shows my problem:
jasmine.clock().mockDate doesn't seem to work for a minute while it works fine for Date .
describe('Jasmine tests', function () { beforeEach(function() { jasmine.clock().install(); }); afterEach(function() { jasmine.clock().uninstall(); });
Why is Date working as expected and moment not working? Doesn't moment use Date under the hood?
What is the right way to fake moment with Jasmine?
javascript momentjs jasmine
jacwah
source share