diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3c35d6f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "i18n-ally.localesPaths": [ + "locales" + ] +} \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 4844afd..e4d705b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent { docker { - image 'node:20' + image 'node:22' } } @@ -30,25 +30,21 @@ pipeline { } } - stage('checks') { - parallel { - stage('eslint') { - steps { - sh 'npm run eslint' - } - } + stage('eslint') { + steps { + sh 'npm run eslint' + } + } - stage('test') { - steps { - sh 'npm run test' - } - } + stage('test') { + steps { + sh 'npm run test' + } + } - stage('build') { - steps { - sh 'npm run build' - } - } + stage('build') { + steps { + sh 'npm run build' } } diff --git a/package.json b/package.json index ed10c91..84f85b9 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "build": "npm run clean && brojs build --dev", "build:prod": "npm run clean && brojs build", "clean": "rimraf dist", - "eslint": "npx eslint .", - "eslint:fix": "npx eslint . --fix", + "eslint": "npx eslint src", + "eslint:fix": "npx eslint src --fix", "preversion": "npm run eslint" }, "keywords": [], diff --git a/src/__data__/store.ts b/src/__data__/store.ts index dabb855..7fe0918 100644 --- a/src/__data__/store.ts +++ b/src/__data__/store.ts @@ -7,7 +7,9 @@ export const store = configureStore({ [api.reducerPath]: api.reducer, }, middleware: (getDefaultMiddleware) => - getDefaultMiddleware().concat(api.middleware), + getDefaultMiddleware({ + serializableCheck: false + }).concat(api.middleware), }); export type RootState = ReturnType; diff --git a/src/components/ErrorBoundary/ErrorBoundary.tsx b/src/components/ErrorBoundary/ErrorBoundary.tsx index d0fc96a..6385951 100644 --- a/src/components/ErrorBoundary/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary/ErrorBoundary.tsx @@ -28,7 +28,6 @@ class ErrorBoundary extends Component { componentDidCatch(error: Error, errorInfo: ErrorInfo): void { console.error('Error caught by ErrorBoundary:', error, errorInfo); - console.error('4545'); this.setState({ error, errorInfo }); } diff --git a/src/components/ErrorBoundary/__tests__/ErrorBoundary.test.tsx b/src/components/ErrorBoundary/__tests__/ErrorBoundary.test.tsx index a194bcd..db19d52 100644 --- a/src/components/ErrorBoundary/__tests__/ErrorBoundary.test.tsx +++ b/src/components/ErrorBoundary/__tests__/ErrorBoundary.test.tsx @@ -24,6 +24,10 @@ jest.mock('@brojs/cli', () => { describe('ErrorBoundary', () => { it('должен отобразить запасной UI при ошибке', async () => { + // Подавляем вывод ошибки в консоль во время теста + const consoleSpy = jest.spyOn(console, 'error'); + consoleSpy.mockImplementation(() => {}); + const { container } = render( @@ -39,7 +43,9 @@ describe('ErrorBoundary', () => { ); expect(button).not.toBeNull(); - expect(container).toMatchSnapshot(); + + // Восстанавливаем console.error после теста + consoleSpy.mockRestore(); }); }); diff --git a/src/pages/__tests__/__snapshots__/masters.test.tsx.snap b/src/pages/__tests__/__snapshots__/masters.test.tsx.snap index 276475c..fc26ae6 100644 --- a/src/pages/__tests__/__snapshots__/masters.test.tsx.snap +++ b/src/pages/__tests__/__snapshots__/masters.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Master Page render 1`] = ` +exports[`Master Page should display master list and show details when master button is clicked 1`] = `
`; -exports[`Order View page, initial load shows order details loading 1`] = ` +exports[`Страница просмотра заказа отображает индикатор загрузки деталей заказа 1`] = `
`; -exports[`Order View page, initial load shows order error 1`] = ` +exports[`Страница просмотра заказа отображает ошибку при некорректном ID заказа 1`] = `
- 16.02.2025 + 20.02.2025