Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!