Skip to content

Add codemod to convert input selectors passed as separate inline arguments to a single array #17

Add codemod to convert input selectors passed as separate inline arguments to a single array

Add codemod to convert input selectors passed as separate inline arguments to a single array #17

Triggered via pull request May 14, 2024 16:53
Status Failure
Total duration 1m 19s
Artifacts

test-reselect-codemods.yml

on: pull_request
Matrix: Run test Suite
Fit to window
Zoom out
Zoom in

Annotations

28 errors
Run test Suite (latest, ubuntu-latest)
Could not get yarn cache folder path for /home/runner/work/reselect/reselect
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments-ts.ts > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ 'import {', …(209) ] to strictly equal [ 'import {\r', …(209) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const state: RootState = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap( ", - " [(state: RootState) => state.todos], ", - " (todos) => todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotr
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments-ts.ts > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ 'import {', …(209) ] to strictly equal [ 'import {\r', …(209) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const state: RootState = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap( ", - " [(state: RootState) => state.todos], ", - " (todos) => todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotr
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ 'import {', …(169) ] to strictly equal [ 'import {\r', …(169) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "const state = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap([(state) => state.todos], (todos) => ", - " todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize, memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize } ", - ") ", - " ", - "const selectorBothWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize, memoize: weakMapMemoiz
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ 'import {', …(169) ] to strictly equal [ 'import {\r', …(169) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "const state = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap([(state) => state.todos], (todos) => ", - " todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize, memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize } ", - ") ", - " ", - "const selectorBothWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize, memoize: weakMapMemoiz
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ …(33) ] to strictly equal [ …(33) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const createAppSelector = createSelector.withTypes<RootState>() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes<RootState>() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes<RootState>() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "interface RootState {", + " todos: {", + " id: number", + " completed: boolean", + " }[]", + "}", + "", + "const createAppSelector = createSelector.withTypes<RootState>()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes<RootState>()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes<RootState>()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:54:39
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ …(33) ] to strictly equal [ …(33) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const createAppSelector = createSelector.withTypes<RootState>() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes<RootState>() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes<RootState>() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "interface RootState {", + " todos: {", + " id: number", + " completed: boolean", + " }[]", + "}", + "", + "const createAppSelector = createSelector.withTypes<RootState>()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes<RootState>()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes<RootState>()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:69:39
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ …(26) ] to strictly equal [ …(26) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "const createAppSelector = createSelector.withTypes() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "const createAppSelector = createSelector.withTypes()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:54:39
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ …(26) ] to strictly equal [ …(26) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "const createAppSelector = createSelector.withTypes() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "const createAppSelector = createSelector.withTypes()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:69:39
Run test Suite (latest, windows-latest)
Process completed with exit code 1.
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments-ts.ts > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ 'import {', …(209) ] to strictly equal [ 'import {\r', …(209) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const state: RootState = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap( ", - " [(state: RootState) => state.todos], ", - " (todos) => todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotr
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments-ts.ts > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ 'import {', …(209) ] to strictly equal [ 'import {\r', …(209) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const state: RootState = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap( ", - " [(state: RootState) => state.todos], ", - " (todos) => todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotr
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ 'import {', …(169) ] to strictly equal [ 'import {\r', …(169) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "const state = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap([(state) => state.todos], (todos) => ", - " todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize, memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize } ", - ") ", - " ", - "const selectorBothWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize, memoize: weakMapMemoiz
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ 'import {', …(169) ] to strictly equal [ 'import {\r', …(169) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "const state = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap([(state) => state.todos], (todos) => ", - " todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize, memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize } ", - ") ", - " ", - "const selectorBothWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize, memoize: weakMapMemoiz
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ …(33) ] to strictly equal [ …(33) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const createAppSelector = createSelector.withTypes<RootState>() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes<RootState>() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes<RootState>() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "interface RootState {", + " todos: {", + " id: number", + " completed: boolean", + " }[]", + "}", + "", + "const createAppSelector = createSelector.withTypes<RootState>()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes<RootState>()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes<RootState>()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:54:39
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ …(33) ] to strictly equal [ …(33) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const createAppSelector = createSelector.withTypes<RootState>() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes<RootState>() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes<RootState>() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "interface RootState {", + " todos: {", + " id: number", + " completed: boolean", + " }[]", + "}", + "", + "const createAppSelector = createSelector.withTypes<RootState>()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes<RootState>()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes<RootState>()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:69:39
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ …(26) ] to strictly equal [ …(26) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "const createAppSelector = createSelector.withTypes() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "const createAppSelector = createSelector.withTypes()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:54:39
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ …(26) ] to strictly equal [ …(26) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "const createAppSelector = createSelector.withTypes() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "const createAppSelector = createSelector.withTypes()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:69:39
Run test Suite (18, windows-latest)
Process completed with exit code 1.
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments-ts.ts > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ 'import {', …(209) ] to strictly equal [ 'import {\r', …(209) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const state: RootState = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap( ", - " [(state: RootState) => state.todos], ", - " (todos) => todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotr
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments-ts.ts > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ 'import {', …(209) ] to strictly equal [ 'import {\r', …(209) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const state: RootState = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state: RootState) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap( ", - " [(state: RootState) => state.todos], ", - " (todos) => todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state: RootState, id: number) => id, (state: RootState) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state: RootState) => state.todos, (state: RootState, id: number) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotr
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ 'import {', …(169) ] to strictly equal [ 'import {\r', …(169) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "const state = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap([(state) => state.todos], (todos) => ", - " todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize, memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize } ", - ") ", - " ", - "const selectorBothWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize, memoize: weakMapMemoiz
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ 'import {', …(169) ] to strictly equal [ 'import {\r', …(169) ] - Expected + Received Array [ - "import { ", - " unstable_autotrackMemoize as autotrackMemoize, ", - " createSelector, ", - " createSelectorCreator, ", - " lruMemoize, ", - " weakMapMemoize ", - "} from 'reselect' ", - " ", - "const state = { ", - " todos: [ ", - " { id: 0, completed: false }, ", - " { id: 1, completed: false } ", - " ] ", - "} ", - " ", - "const selectorDefault = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id)) ", - " ", - "const selectorDefaultParametric = createSelector( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selectorLodashFunc = createSelector([(state) => state.todos], (todos) => todos.map((t) => t.id), { ", - " memoizeOptions: [] ", - "}) ", - " ", - "const createSelectorWeakMap = createSelectorCreator(weakMapMemoize) ", - " ", - "const selector1 = createSelectorWeakMap([(state) => state.todos], (todos) => ", - " todos.map((t) => t.id) ", - ") ", - " ", - "const selector2 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id) ", - ") ", - " ", - "const selector3 = createSelectorWeakMap( ", - " [(state, id) => id, (state) => state.todos], ", - " (id, todos) => todos.filter((t) => t.id === id), ", - " { memoizeOptions: [] } ", - ") ", - " ", - "const selectorDefault2 = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id) ", - ") ", - " ", - "const selectorDefaultWithCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: lruMemoize, memoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithArgsCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: lruMemoize, argsMemoizeOptions: { maxSize: 30 } } ", - ") ", - " ", - "const selectorDefaultWithBothCacheSize = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize, ", - " memoizeOptions: { maxSize: 30 }, ", - " argsMemoizeOptions: { maxSize: 30 } ", - " } ", - ") ", - " ", - "const selectorWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: weakMapMemoize } ", - ") ", - " ", - "const selectorAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize } ", - ") ", - " ", - "const selectorBothAutotrack = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: autotrackMemoize, memoize: autotrackMemoize } ", - ") ", - " ", - "const selectorArgsWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize } ", - ") ", - " ", - "const selectorBothWeakMap = createSelector( ", - " [(state) => state.todos, (state, id) => id], ", - " (todos, id) => todos.map((todo) => todo.id === id), ", - " { argsMemoize: weakMapMemoize, memoize: weakMapMemoiz
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ …(33) ] to strictly equal [ …(33) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const createAppSelector = createSelector.withTypes<RootState>() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes<RootState>() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes<RootState>() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "interface RootState {", + " todos: {", + " id: number", + " completed: boolean", + " }[]", + "}", + "", + "const createAppSelector = createSelector.withTypes<RootState>()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes<RootState>()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes<RootState>()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:54:39
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ …(33) ] to strictly equal [ …(33) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "interface RootState { ", - " todos: { ", - " id: number ", - " completed: boolean ", - " }[] ", - "} ", - " ", - "const createAppSelector = createSelector.withTypes<RootState>() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes<RootState>() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes<RootState>() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "interface RootState {", + " todos: {", + " id: number", + " completed: boolean", + " }[]", + "}", + "", + "const createAppSelector = createSelector.withTypes<RootState>()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes<RootState>()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes<RootState>()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:69:39
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > transforms correctly: codemods/transformTestUtils.ts#L54
AssertionError: expected [ …(26) ] to strictly equal [ …(26) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "const createAppSelector = createSelector.withTypes() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "const createAppSelector = createSelector.withTypes()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:54:39
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > is idempotent: codemods/transformTestUtils.ts#L69
AssertionError: expected [ …(26) ] to strictly equal [ …(26) ] - Expected + Received Array [ - "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect' ", - " ", - "const createAppSelector = createSelector.withTypes() ", - " ", - "const createSelectorLru = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}) ", - " ", - "const createAppSelectorLru = createSelectorLru.withTypes() ", - " ", - "const createStateSelector = createSelectorCreator({ ", - " memoize: lruMemoize, ", - " argsMemoize: lruMemoize ", - "}).withTypes() ", - " ", - "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id)) ", - " ", - "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), { ", - " argsMemoize: lruMemoize, ", - " memoize: lruMemoize ", + "import { createSelector, createSelectorCreator, lruMemoize } from 'reselect'", + "", + "const createAppSelector = createSelector.withTypes()", + "", + "const createSelectorLru = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "})", + "", + "const createAppSelectorLru = createSelectorLru.withTypes()", + "", + "const createStateSelector = createSelectorCreator({", + " memoize: lruMemoize,", + " argsMemoize: lruMemoize", + "}).withTypes()", + "", + "const selectTodoIds = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds2 = createAppSelectorLru([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIds3 = createStateSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id))", + "", + "const selectTodoIdsWithOptions = createAppSelector([(state) => state.todos], (todos) => todos.map(({ id }) => id), {", + " argsMemoize: lruMemoize,", + " memoize: lruMemoize", "})", ] ❯ transformTestUtils.ts:69:39
Run test Suite (20, windows-latest)
Process completed with exit code 1.