moment-timezone icon indicating copy to clipboard operation
moment-timezone copied to clipboard

Unable to run Karma Jasmine specs using moment-timezone

Open satyaki1 opened this issue 7 years ago • 3 comments

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',

satyaki1 avatar Jan 02 '18 11:01 satyaki1

Same problem here, but I'm running the tests with Jest. Version 0.5.13 works fine.

victormiguez avatar Jan 08 '18 19:01 victormiguez

@satyaki1 Do you have any resolution for it. I am in the same boat.

vpratti avatar May 30 '18 18:05 vpratti

@vpratti No luck. @ellenaua @mj1856 Any clue on this?

satyaki1 avatar Jun 06 '18 06:06 satyaki1