I am currently writing a unit test for my selector. Which would take in nested arrays and return a single array. I am using .flat() operator for this. For some reason I get this error:

TypeError: contactInfoSelection.flat is not a function

Please find below my selector and my current unit test case. Any suggestions on how to approach it would be great!

export const getSingledArray = createSelector(
(contactInfoSelection) => {
return contactInfoSelection.flat(); 

//test case

it('should return singled array from nested arrays', () => {
    store.dispatch(new ContactInfoSelectionSucceeded(getContactInfoSelectionMock()));   

      .subscribe((contentInfo:any) => {expect(contentInfo).toEqual(

0 Answers