🤡(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:
Anthony LC
2024-04-04 16:59:04 +02:00
committed by Anthony LC
parent 79831154be
commit 603ece466d
2 changed files with 6 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ const jestConfig = async () => {
moduleNameMapper: {
'\\.svg$': '<rootDir>/jest/mocks/svg.js',
'^.+\\.svg\\?url$': `<rootDir>/jest/mocks/fileMock.js`,
BlockNoteEditor: `<rootDir>/jest/mocks/ComponentMock.js`,
...nextJestConfig.moduleNameMapper,
},
};

View File

@@ -0,0 +1,5 @@
import React from 'react';
export const ComponentMock = () => {
return <div>My component mocked</div>;
};