🤡(app-impress) mock BlockNoteEditor
BlockNoteEditor uses many libraries not compatible with Jest. This commit mocks the BlockNoteEditor component to allow Jest to run without errors.
This commit is contained in:
@@ -22,6 +22,7 @@ const jestConfig = async () => {
|
|||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'\\.svg$': '<rootDir>/jest/mocks/svg.js',
|
'\\.svg$': '<rootDir>/jest/mocks/svg.js',
|
||||||
'^.+\\.svg\\?url$': `<rootDir>/jest/mocks/fileMock.js`,
|
'^.+\\.svg\\?url$': `<rootDir>/jest/mocks/fileMock.js`,
|
||||||
|
BlockNoteEditor: `<rootDir>/jest/mocks/ComponentMock.js`,
|
||||||
...nextJestConfig.moduleNameMapper,
|
...nextJestConfig.moduleNameMapper,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
5
src/frontend/apps/impress/jest/mocks/ComponentMock.js
Normal file
5
src/frontend/apps/impress/jest/mocks/ComponentMock.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
export const ComponentMock = () => {
|
||||||
|
return <div>My component mocked</div>;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user