Carlos Luis Rivero
Carlos Luis Rivero

Reputation: 177

npm run test @nrwl/angular: It looks like your application or one of its dependencies is using i18n

If you got following message when run test in angular:

It looks like your application or one of its dependencies is using i18n.
Angular 9 introduced a global `$localize()` function that needs to be loaded.
Please run `ng add @angular/localize` from the Angular CLI

Conditions:

"@angular/core": "^10.0.0",
"@angular/elements": "^10.0.4",
"@angular/forms": "^10.0.0",
"@angular/localize": "^10.1.2",
"@angular/platform-browser": "^10.0.0",
"@angular/platform-browser-dynamic": "^10.0.0",
"@angular/router": "^10.0.0",
"@ng-bootstrap/ng-bootstrap": "^7.0.0",
"@nrwl/angular": "10.0.2",
"ngx-build-plus": "^10.1.1",

Upvotes: 0

Views: 539

Answers (1)

Carlos Luis Rivero
Carlos Luis Rivero

Reputation: 177

To solve this issue, only add in test-settup.ts:

import 'jest-preset-angular';
import '@angular/localize/init';

Upvotes: 5

Related Questions