angularjs - Javascript Internationalization API is not supported by PhantomJS -
i have series of jasmine tests running against angularjs service uses ecmascript internationalization api. run when run them through chrome. however, when use phantomjs run them through maven, fail seems phantomjs not support internationalization api yet.
the error message tests using intl object :
1: referenceerror: can't find variable: intl in localizationservice.js
and rest of tests fail.
the tests simple , this:
it('format date en-us locale', (function (){ var date= "06/13/2013" expect(service.date(date,'en-us')).toequal("6/13/2013"); })) and methods in service (localizationservice.js) simple wrappers around intl api:
function getcurrenttimezone(){ return intl.datetimeformat().resolved.timezone } function date(dateinput,locale,options){ // other stuff // ... if (locale) { return _date.tolocaledatestring(locale,options); } else { return _date.tolocaledatestring(); } } my questions are:
1- assumption correct phantomjs v1.9.2 not support ecmascript internationalization api? there anyway confirm that?
2- how can approach resolving issue? need run tests through maven , have more tests hitting localizationservice api 1 way or other.
1- assumption correct phantomjs v1.9.2 not support ecmascript internationalization api? there anyway confirm that?
it looks phantomjs based on webkit, not support new ecmascript internationalization api.
even chrome, api made v8 recently, still in beeding_edge, not in main: see http://code.google.com/p/v8/source/browse/branches/bleeding_edge/src/, i18n files (.cc, .h, .js). means after split webkit.
here current status i18n support: http://mihai-nita.net/2013/07/28/javascript-internationalization-api/
2- how can approach resolving issue? need run tests through maven , have more tests hitting localizationservice api 1 way or other.
if maintainer of phantomjs consider going google branch of webkit, before diverge , make hard catch-up. chrome has more of market safari (not , invitation flame wars, personal opinion without weight :-)
i not familiar phantomjs, , don't know offers, if can separate javascript tests run on v8 might try using testing command line. building beeding_edge painless, , did on win, mac os x, , linux without problems.
Comments
Post a Comment