-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unit tests to roosterjs - react #2343
Comments
@gm-al sure please go ahead and our team will be happy to do code review. |
I'm working on writing the unit tests for the
an example of a unit test: describe('createPasteOptionPlugin', () => {
let editor: IEditor;
let plugin: ReactEditorPlugin;
beforeEach(() => {
plugin = createPasteOptionPlugin();
editor = initEditor(div, [plugin]);
plugin.initialize(editor);
});
it('getName', () => {
expect(plugin.getName()).toEqual('PasteOption');
});
}); I'm not sure what I'm missing but the |
From the error message, it is complaining the keyword "type". Can you try to remove it? Currently we didn't force adding "type" import for test code, so we didn't test when adding it if it can pass the build |
Yes, actually I did that earlier and got another error but now that I am thinking about it, I think webpack is complaining about the code being imported from the
|
@gm-al FYI, we will upgrade the roosterjs-react code to be v9 and use new v9 editor in a near future. Although in this change most logic is not changed, but all the code interfaces will be moved to using v9 types. So if you are still working on the unit test, you may hold on and wait for this v9 change so that your test can target to the new roosterjs-react code. |
@ganitx FYI, now roosterjs-react is on top of roosterjs v9, and there will not be more major changes recently. So please feel free to add unit tests when you have time. Thanks. |
How about writing end-to-end testing for roosterJs-react, currently the test dir doesn't have any tests. I would like to work on this @JiuqingSong thank you!
Tasks
Tasks
The text was updated successfully, but these errors were encountered: