Skip to content

Commit e7d2685

Browse files
committed
fix: unit tests
1 parent 7b36f31 commit e7d2685

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

config-overrides.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = {
5858
// By default jest does not transform anything in node_modules
5959
// So this override excludes node_modules except @gravity-ui
6060
// see https://github.com/timarney/react-app-rewired/issues/241
61-
config.transformIgnorePatterns = ['node_modules/(?!(@gravity-ui)/)'];
61+
config.transformIgnorePatterns = ['node_modules/(?!(@gravity-ui|@mjackson)/)'];
6262

6363
// Add .github directory to roots
6464
config.roots = ['<rootDir>/src', '<rootDir>/.github'];

src/services/api/streaming.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// eslint-disable-next-line import/no-extraneous-dependencies
21
import {parseMultipart} from '@mjackson/multipart-parser';
32
import qs from 'qs';
43

src/setupTests.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable import/order */
1+
/* eslint-disable import/order, no-undef */
22
// jest-dom adds custom jest matchers for asserting on DOM nodes.
33
// allows you to do things like:
44
// expect(element).toHaveTextContent(/react/i)
@@ -14,3 +14,8 @@ configureUiKit({lang: Lang.En});
1414
// only to prevent warnings from history lib
1515
// all api calls in tests should be mocked
1616
window.custom_backend = '/';
17+
18+
// Mock multipart-parser globally for all tests
19+
jest.mock('@mjackson/multipart-parser', () => ({
20+
parseMultipart: jest.fn(),
21+
}));

0 commit comments

Comments
 (0)