Skip to content
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

Unable to run Karma Jasmine specs using moment-timezone #570

Open
satyaki1 opened this issue Jan 2, 2018 · 3 comments
Open

Unable to run Karma Jasmine specs using moment-timezone #570

satyaki1 opened this issue Jan 2, 2018 · 3 comments

Comments

@satyaki1
Copy link

satyaki1 commented Jan 2, 2018

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

@victormiguez
Copy link

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

@vpratti
Copy link

vpratti commented May 30, 2018

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

@satyaki1
Copy link
Author

satyaki1 commented Jun 6, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants