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
Explore unit Testing using Mocha #375
Comments
As we discussed, @sophieeng will spend another three weeks or so on this issue and #365. |
Steps to use Mocha:
Notes:
|
There are some large issues, which I believe will apply to all testing frameworks. As I mentioned above, I changed Testing frameworks don't seem to be very easily used with ESM. I am currently looking into configuring Mocha, using babel most likely, like this. Seems like a problem that has a large scope and we should consider abandoning testing if I can't get it to work soon, like Sebastian talked about only spending 3 more weeks on this. |
@sophieeng, maybe use a different test framework? Can you check whether the following work (in that order): I got these from a Stackoverflow post. The post also mentions that Mocha supports ESM but with some limitations. So, maybe using that we can also keep Mocha. Whatever works better. |
The most recent is a working Mocha test, without modifying the code of the extension, with the exception of package.json. Therefore, Mocha does work with ESM but I need to look into the limitations and if this part of Mocha is still being up-kept. The issue is that the webpack.config.js is written in CommonJS, so when I had to modify package.json to "type: module" it will not work with the formatting of CommonJS so the extension won't load and I can't test the functionality of the extension. |
In our meeting today, @sophieeng clarified the two tasks to perform:
|
Example tests have been successfully merged and work correctly. Closing issue |
This is a separate branch for my Mocha tests as to not cross over the different testing frameworks. Mocha was the most popular Javascript testing framework before Jest. Using Mocha, I'm interested to see if my issues in Jest carry over, which will be a sign as to whether the extension or the testing frameworks are causing the errors I'm getting.
The text was updated successfully, but these errors were encountered: