How to use the @ngneat/transloco.TranslocoTestingModule.withLangs function in @ngneat/transloco

To help you get started, we’ve selected a few @ngneat/transloco examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ngneat / transloco / src / app / transloco-testing.module.ts View on Github external
export function getTranslocoModule(config: Partial = {}) {
  return TranslocoTestingModule.withLangs(
    {
      en,
      es,
      'admin-page/en': admin,
      'admin-page/es': adminSpanish,
      'lazy-page/en' : lazy,
      'lazy-page/es' : lazySpanish
    },
    {
      availableLangs: ['es', 'en'],
      defaultLang: 'es',
      ...config
    }
  );
}
github ngneat / transloco / src / app / app.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule,
        TranslocoTestingModule.withLangs({
          en
        })
      ],
      declarations: [AppComponent]
    }).compileComponents();
  }));