Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

251
Vistas
Angular strict mode, Ngrx, Jamsmine: mock selector with props

I am currently trying to remove the deprecated selectors in my application. This github issue telling us to declare selector with props as a function.

Old way (deprecated):

export const getCurrentScope = createSelector(getContextState, (state: ContextState, arg: string) => {
   return state.object + arg;
}

New Way:

export const getCurrentScope = (arg: string) => createSelector(getContextState, (state: ContextState) => {
   return state.object + arg;
}

With the deprecated method I was able to mock the selector by overriding it with the overrideSelector function.

Now that getCurrentScope is no longer a selector I cannot use the overrideSelector function.

So I'm trying to mock the function as follow:

import * as contextSelector from '@core/store/selectors/context.selectors';
spyOn(contextSelector, 'getCurrentScope').and.returnValue( ??? );

As I'm working with Angular Strict Mode, I have to return a MemoizedSelector but I do not find any way to perform it.

Can someone help me on this ?

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda