moment-timezone
moment-timezone copied to clipboard
Unable to run Karma Jasmine specs using moment-timezone
I am using AngularJS 1.5.5 application with following moment libs added - moment - v2.13.0 moment-timezone - v0.5.13
I don't face any issue while running the application with the following code in app.js in browser
moment.tz.setDefault("Asia/Singapore");
But the same line throws error while I'm running my specs written in Jasmine v2.5.2 using karma v.^1.4.0. The error is :
TypeError: Cannot read property 'setDefault' of undefined
This is how my karma.conf.js - files attribute looks like -
'vendor/assets/bower_components/moment/moment.js', 'vendor/assets/bower_components/moment-timezone/moment-timezone.js', 'vendor/assets/bower_components/moment-timezone/builds/moment-timezone-with-data.js', 'vendor/assets/bower_components/moment-timezone/builds/moment-timezone-with-data-2012-2022.js', 'vendor/assets/bower_components/angular-mocks/angular-mocks.js',
Same problem here, but I'm running the tests with Jest.
Version 0.5.13
works fine.
@satyaki1 Do you have any resolution for it. I am in the same boat.
@vpratti No luck. @ellenaua @mj1856 Any clue on this?