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

feat: move to jest #1144

Open
weboko opened this issue Feb 1, 2023 · 3 comments
Open

feat: move to jest #1144

weboko opened this issue Feb 1, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@weboko
Copy link
Collaborator

weboko commented Feb 1, 2023

This is a change request

Problem

Right now @waku/* projects more or less follow the same testing stack/approach:

  • mocha, karma, chai for the stack;
  • run tests in headless Chrome;

Proposed Solutions

I think it is better for us to move to jest due to various factors:

  • all-in-one lib (no need to configure additionally if something is needed such as spy lib);
  • seamless local experience;
  • easy to configure browser like environment;
  • configurable with puppeteer;

Notes

One of the features I'd like to unlock by introducing jest is opportunity to test in different browsers. In case of Chrome there are no problems, but if Firefox or some other browser is our goal - we will have to choose automated testing approach and use Cypress or similar solution such as Browser Stack.

Before going deep into integrating testing with other browsers I'd like to take a step back and point out goals of it:

  • make sure library is interpretable by different browsers;
  • library is run the same way in different browsers;

I think that we can cover those cases in a good enough way by:

  • defining list of supported browsers;
  • using polyfills;
  • setting build system in a way it targets supported browsers;
  • running tests in a browser like (or Chrome) environment;
    This list is based on the fact that we are speaking about JS library and assumption that the only thing that can work differently within various browsers is API used and not transformed properly (no polyfill e.g).

Related PRs: waku-org/js-rln#45

cc: @fryorcraken

@weboko weboko added the enhancement New feature or request label Feb 1, 2023
@weboko weboko self-assigned this Feb 1, 2023
@fryorcraken
Copy link
Collaborator

using polyfills

I don't think any of the current stack use polyfills.

make sure library is interpretable by different browsers;

It's possible to do with Karma

Right now @waku/* projects more or less follow the same testing stack/approach:

mocha, karma, chai for the stack;
run tests in headless Chrome;

The problem statement seems to be more a description of the current stack. Could you be more specific on the gains we would have in migrating to jest? I expect the migration to be costly and hence I just want to ensure we have a high ROI for this change.

@danisharora099
Copy link
Collaborator

I propose to move this to triage/todo in reference to #1523

@danisharora099
Copy link
Collaborator

moving this back to icebox -- not relevant for now; we can revisit this if we find a use-case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Icebox
Development

No branches or pull requests

3 participants