chore: add prettier and run it on all files

This commit is contained in:
2024-08-17 17:30:56 +02:00
parent 143b48c7a9
commit 2f8ff0d004
28 changed files with 1609 additions and 1117 deletions

View File

@@ -1,22 +1,26 @@
import { appReducer, InitialStateType, setAppErrorAC, setAppStatusAC } from './app-reducer'
import {
appReducer,
InitialStateType,
setAppErrorAC,
setAppStatusAC,
} from './app-reducer'
let startState: InitialStateType;
let startState: InitialStateType
beforeEach(() => {
startState = {
error: null,
status: 'idle',
isInitialized: false
}
startState = {
error: null,
status: 'idle',
isInitialized: false,
}
})
test('correct error message should be set', () => {
const endState = appReducer(startState, setAppErrorAC('some error'))
expect(endState.error).toBe('some error');
const endState = appReducer(startState, setAppErrorAC('some error'))
expect(endState.error).toBe('some error')
})
test('correct status should be set', () => {
const endState = appReducer(startState, setAppStatusAC('loading'))
expect(endState.status).toBe('loading');
const endState = appReducer(startState, setAppStatusAC('loading'))
expect(endState.status).toBe('loading')
})