/* eslint comma-dangle: 0 */
import createCachedSelector from '../index';

describe('createCachedSelector', () => {
  it('Should return the same cached reselect selector when resolver function returns the same string', () => {
    const cachedSelector = createCachedSelector(
      (arg1, arg2) => arg2,   // Resolver
    )(
      () => ({}),
    );
    const firstCallResult = cachedSelector('foo', 'bar');
    const secondCallResult = cachedSelector('foo', 'bar');

    expect(firstCallResult).toBe(secondCallResult);
    expect(firstCallResult).toEqual({});
  });

  it('Should return 2 different reselect selector instances when resolver function returns different strings', () => {
    const cachedSelector = createCachedSelector(
      (arg1, arg2) => arg2,   // Resolver
    )(
      () => ({}),
    );
    const firstCallResult = cachedSelector('foo', 'bar');
    const secondCallResult = cachedSelector('foo', 'moo');

    expect(firstCallResult).not.toBe(secondCallResult);
    expect(firstCallResult).toEqual({});
  });
});

@@ -68,16 +68,95 @@
 ndex';%0A%0A
+let memoizedFunction;%0A%0AbeforeEach(() =%3E %7B%0A  memoizedFunction = jest.fn();%0A%7D);%0A%0A
 describe
@@ -201,22 +201,19 @@
 'Should 
-return
+use
  the sam
@@ -221,25 +221,16 @@
  cached 
-reselect 
 selector
@@ -387,34 +387,40 @@
    )(%0A      
-() =%3E (%7B%7D)
+memoizedFunction
 ,%0A    );%0A   
@@ -427,38 +427,32 @@
  const firstCall
-Result
  = cachedSelecto
@@ -480,38 +480,48 @@
 const secondCall
-Result
+WithSameResolver
  = cachedSelecto
@@ -553,87 +553,50 @@
 ect(
-firstCallResult).toBe(secondCallResult);%0A    expect(firstCallResult).toEqual(%7B%7D
+memoizedFunction.mock.calls.length).toBe(1
 );%0A 
@@ -614,22 +614,22 @@
 'Should 
+c
 re
-turn
+ate
  2 diffe
@@ -637,34 +637,16 @@
 ent 
-reselect selector instance
+selector
 s wh
@@ -810,18 +810,24 @@
     
-() =%3E (%7B%7D)
+memoizedFunction
 ,%0A  
@@ -905,30 +905,45 @@
 t secondCall
-Result
+WithDifferentResolver
  = cachedSel
@@ -979,91 +979,50 @@
 ect(
-firstCallResult).not.toBe(secondCallResult);%0A    expect(firstCallResult).toEqual(%7B%7D
+memoizedFunction.mock.calls.length).toBe(2
 );%0A 

Make tests more expressive