We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Yes.
When using Angular 5, any localization in unit tests seems to fail.
Both
I have created a demo app at https://github.com/YvesCandel/tns-34-ng-52-locales
The issue can be reproduced using:
git clone https://github.com/YvesCandel/tns-34-ng-52-locales.git cd tns-34-ng-52-locales npm i tns test ios --justlaunch --emulator
git clone https://github.com/YvesCandel/tns-34-ng-52-locales.git
cd tns-34-ng-52-locales
npm i
tns test ios --justlaunch --emulator
All the tests will fail because the locale data cannot be found:
PercentPipe transform ✗ should return correct value for numbers TypeError: undefined is not an object (evaluating 'data[0 /* LocaleId */]') in file:///app/tns_modules/@angular/common/bundles/common.umd.js (line 1020) registerLocaleData@file:///app/tns_modules/@angular/common/bundles/common.umd.js:1020:24 file:///app/tests/decimal.pipe.spec.js:12:40 attempt run execute queueRunnerFactory fn attempt run execute queueRunnerFactory execute execute runTests@file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:216:23 file:///app/tns_modules/nativescript-unit-test-runner/main-view-model.js:187:101 invoke@file:///app/tns_modules/tns-core-modules/timer/timer.js:54:53 tick@file:///app/tns_modules/tns-core-modules/timer/timer.js:19:26 UIApplicationMain@[native code] start@file:///app/tns_modules/tns-core-modules/application/application.js:235:26 anonymous@file:///app/tns_modules/nativescript-unit-test-runner/app.js:3:18 evaluate@[native code] moduleEvaluation@[native code] [native code] promiseReactionJob@[native code] Error: Missing locale data for the locale "fr". in file:///app/tns_modules/@angular/common/bundles/common.umd.js (line 1542) findLocaleData@file:///app/tns_modules/@angular/common/bundles/common.umd.js:1542:20 getLocaleNumberFormat@file:///app/tns_modules/@angular/common/bundles/common.umd.js:1385:47 formatNumber$1@file:///app/tns_modules/@angular/common/bundles/common.umd.js:5000:56 transform@file:///app/tns_modules/@angular/common/bundles/common.umd.js:6206:32 file:///app/tests/decimal.pipe.spec.js:65:42 attempt run execute queueRunnerFactory execute fn attempt run execute queueRunnerFactory fn attempt run execute queueRunnerFactory fn attempt run runNext onComplete invoke@file:///app/tns_modules/tns-core-modules/timer/timer.js:54:53 tick@file:///app/tns_modules/tns-core-modules/timer/timer.js:19:26 UIApplicationMain@[native code] start@file:///app/tns_modules/tns-core-modules/application/application.js:235:26 anonymous@file:///app/tns_modules/nativescript-unit-test-runner/app.js:3:18 evaluate@[native code] moduleEvaluation@[native code] [native code] promiseReactionJob@[native code]
The code can be found in the app/tests folder. The unit test is copied from the main Angular project. (https://github.com/angular/angular/blob/master/packages/common/test/pipes/number_pipe_spec.ts)
The text was updated successfully, but these errors were encountered:
closing as related to #1133 - please use the linked issue for updates related to supporting the Angular-5 localization.
Sorry, something went wrong.
No branches or pull requests
Please, provide the details below:
Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?
Yes.
Tell us about the problem
When using Angular 5, any localization in unit tests seems to fail.
Which platform(s) does your issue occur on?
Both
Please provide the following version numbers that your issue occurs with:
Please tell us how to recreate the issue in as much detail as possible.
I have created a demo app at https://github.com/YvesCandel/tns-34-ng-52-locales
The issue can be reproduced using:
git clone https://github.com/YvesCandel/tns-34-ng-52-locales.git
cd tns-34-ng-52-locales
npm i
tns test ios --justlaunch --emulator
All the tests will fail because the locale data cannot be found:
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
The code can be found in the app/tests folder. The unit test is copied from the main Angular project. (https://github.com/angular/angular/blob/master/packages/common/test/pipes/number_pipe_spec.ts)
The text was updated successfully, but these errors were encountered: