Add codemod to convert input selectors passed as separate inline arguments to a single array #19
Annotations
27 errors
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments-ts.ts > transforms correctly:
codemods/transformTestUtils.ts#L53
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: autotrackMemoize, memoize: autotrackMemoize }
- )
-
- const selectorArgsWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize }
- )
-
- const selectorBothWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- {
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments-ts.ts > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: autotrackMemoize, memoize: autotrackMemoize }
- )
-
- const selectorArgsWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize }
- )
-
- const selectorBothWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- {
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > transforms correctly:
codemods/transformTestUtils.ts#L53
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: weakMapMemoize }
- )
-
- const arr = [(state) => state.todos, (state, id) => id]
-
- const selectorBothWeakMap1 = createSelector(
- arr,
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize, memoize: weakMapMemoize }
- )
-
- const arr3 = [
- function (state) {
- return state.todos
- },
- function (state, id) {
- return id
- }
- ]
-
- const selectorBothWeakMap4 = createSelector(
- arr3,
- (todos, id) => todos.map((t
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: weakMapMemoize }
- )
-
- const arr = [(state) => state.todos, (state, id) => id]
-
- const selectorBothWeakMap1 = createSelector(
- arr,
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize, memoize: weakMapMemoize }
- )
-
- const arr3 = [
- function (state) {
- return state.todos
- },
- function (state, id) {
- return id
- }
- ]
-
- const selectorBothWeakMap4 = createSelector(
- arr3,
- (todos, id) => todos.map((t
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > transforms correctly:
codemods/transformTestUtils.ts#L53
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:53:28
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:66:28
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > transforms correctly:
codemods/transformTestUtils.ts#L53
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:53:28
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:66:28
|
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#L53
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: autotrackMemoize, memoize: autotrackMemoize }
- )
-
- const selectorArgsWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize }
- )
-
- const selectorBothWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- {
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments-ts.ts > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: autotrackMemoize, memoize: autotrackMemoize }
- )
-
- const selectorArgsWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize }
- )
-
- const selectorBothWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- {
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > transforms correctly:
codemods/transformTestUtils.ts#L53
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: weakMapMemoize }
- )
-
- const arr = [(state) => state.todos, (state, id) => id]
-
- const selectorBothWeakMap1 = createSelector(
- arr,
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize, memoize: weakMapMemoize }
- )
-
- const arr3 = [
- function (state) {
- return state.todos
- },
- function (state, id) {
- return id
- }
- ]
-
- const selectorBothWeakMap4 = createSelector(
- arr3,
- (todos, id) => todos.map((t
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: weakMapMemoize }
- )
-
- const arr = [(state) => state.todos, (state, id) => id]
-
- const selectorBothWeakMap1 = createSelector(
- arr,
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize, memoize: weakMapMemoize }
- )
-
- const arr3 = [
- function (state) {
- return state.todos
- },
- function (state, id) {
- return id
- }
- ]
-
- const selectorBothWeakMap4 = createSelector(
- arr3,
- (todos, id) => todos.map((t
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > transforms correctly:
codemods/transformTestUtils.ts#L53
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:53:28
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:66:28
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > transforms correctly:
codemods/transformTestUtils.ts#L53
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:53:28
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:66:28
|
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#L53
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: autotrackMemoize, memoize: autotrackMemoize }
- )
-
- const selectorArgsWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize }
- )
-
- const selectorBothWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- {
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments-ts.ts > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: autotrackMemoize, memoize: autotrackMemoize }
- )
-
- const selectorArgsWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize }
- )
-
- const selectorBothWeakMap = createSelector(
- [(state: RootState) => state.todos, (state: RootState, id: number) => id],
- (todos, id) => todos.map((todo) => todo.id === id),
- {
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > transforms correctly:
codemods/transformTestUtils.ts#L53
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: weakMapMemoize }
- )
-
- const arr = [(state) => state.todos, (state, id) => id]
-
- const selectorBothWeakMap1 = createSelector(
- arr,
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize, memoize: weakMapMemoize }
- )
-
- const arr3 = [
- function (state) {
- return state.todos
- },
- function (state, id) {
- return id
- }
- ]
-
- const selectorBothWeakMap4 = createSelector(
- arr3,
- (todos, id) => todos.map((t
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > separate-inline-arguments.js > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import {\n unstable_autotrackMemoize…' to be 'import {\n unstable_autotrackMemoize…' // Object.is equality
- Expected
+ Received
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: weakMapMemoize }
- )
-
- const arr = [(state) => state.todos, (state, id) => id]
-
- const selectorBothWeakMap1 = createSelector(
- arr,
- (todos, id) => todos.map((todo) => todo.id === id),
- { argsMemoize: weakMapMemoize, memoize: weakMapMemoize }
- )
-
- const arr3 = [
- function (state) {
- return state.todos
- },
- function (state, id) {
- return id
- }
- ]
-
- const selectorBothWeakMap4 = createSelector(
- arr3,
- (todos, id) => todos.map((t
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > transforms correctly:
codemods/transformTestUtils.ts#L53
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:53:28
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes-ts.ts > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:66:28
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > transforms correctly:
codemods/transformTestUtils.ts#L53
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:53:28
|
transforms/convertInputSelectorsToArray/convertInputSelectorsToArray.test.ts > convertInputSelectorsToArray > withTypes.js > is idempotent:
codemods/transformTestUtils.ts#L66
AssertionError: expected 'import { createSelector, createSelect…' to be 'import { createSelector, createSelect…' // Object.is equality
- Expected
+ Received
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
+
+ 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:66:28
|
Run test Suite (20, windows-latest)
Process completed with exit code 1.
|