Skip to content
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

Integrating Unit Testing tool for PMA's Javascript code #16405

Closed
shucon opened this issue Oct 13, 2020 · 5 comments
Closed

Integrating Unit Testing tool for PMA's Javascript code #16405

shucon opened this issue Oct 13, 2020 · 5 comments
Assignees
Labels
enhancement A feature request for improving phpMyAdmin
Milestone

Comments

@shucon
Copy link
Contributor

shucon commented Oct 13, 2020

We need to add a Unit Testing tool for our Javascript code to avoid bugs in the long run.

I think Jest would be a good tool for us.

cc @MauricioFauth @williamdes

@williamdes
Copy link
Member

williamdes commented Oct 13, 2020

And what are the pros and cons vs using mocha ?

@williamdes williamdes added the enhancement A feature request for improving phpMyAdmin label Oct 13, 2020
@williamdes williamdes added this to Triage zone in Enhancements via automation Oct 13, 2020
@williamdes williamdes moved this from Triage zone to Code base in Enhancements Oct 13, 2020
@shucon
Copy link
Contributor Author

shucon commented Oct 13, 2020

And what are the pros and cons vs using mocha ?

I might be wrong, but I think Jest would be better for Vanilla JS as in our case. I'm still looking into both of them.

Please feel free to weigh in.

@MauricioFauth
Copy link
Member

And what are the pros and cons vs using mocha ?

I might be wrong, but I think Jest would be better for Vanilla JS as in our case. I'm still looking into both of them.

Please feel free to weigh in.

phpMyAdmin uses a lot of jQuery as well.

@shucon
Copy link
Contributor Author

shucon commented Oct 13, 2020

I looked at a couple of sites, but most of them have the same information - https://www.testim.io/blog/best-unit-testing-framework-for-javascript/

  1. Initial setup of Mocha is more complex.
  2. Jest might be more bug prone according to a website. (Source needed)
  3. Jest provides parallel testing.
  4. Jest has a snapshot capturing feature.
  5. Mocha is capable of providing much more flexibility.

@MauricioFauth
Copy link
Member

Could you open a pull request with some tests using Jest?

shucon added a commit to shucon/phpmyadmin that referenced this issue Oct 14, 2020
Related to: phpmyadmin#16405

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
williamdes pushed a commit to shucon/phpmyadmin that referenced this issue Jan 23, 2021
Related to: phpmyadmin#16405

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
@williamdes williamdes self-assigned this Jan 23, 2021
@williamdes williamdes added this to the 5.1.0 milestone Jan 23, 2021
williamdes added a commit that referenced this issue Jan 23, 2021
Pull-request: #16409
Fixes: #16405

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Jan 23, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
Enhancements automation moved this from Code base to Done Jan 23, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement A feature request for improving phpMyAdmin
Projects
Enhancements
  
Done
Development

No branches or pull requests

3 participants