Page MenuHomePhabricator

[web] Add jest library to web
ClosedPublic

Authored by inka on Aug 2 2022, 4:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 12, 7:55 AM
Unknown Object (File)
Wed, May 1, 11:16 PM
Unknown Object (File)
Mon, Apr 29, 2:07 AM
Unknown Object (File)
Mon, Apr 29, 2:07 AM
Unknown Object (File)
Mon, Apr 29, 2:07 AM
Unknown Object (File)
Mon, Apr 29, 2:06 AM
Unknown Object (File)
Mon, Apr 29, 2:06 AM
Unknown Object (File)
Mon, Apr 29, 2:06 AM

Details

Summary

Add jest library to web to allow testing on web.

Test Plan

See that everyting still compiles.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.Aug 2 2022, 4:41 AM

Make eslint work with jest

Accepting this to preempt being added to the review :) (I review all external dependencies)

web/package.json
32 ↗(On Diff #15207)

Thanks for using the same version we used in other libraries!

This revision is now accepted and ready to land.Aug 2 2022, 6:41 AM

Update babel.config.cjs

inka requested review of this revision.Aug 2 2022, 7:38 AM
This revision is now accepted and ready to land.Aug 2 2022, 7:40 AM
This revision now requires review to proceed.Aug 3 2022, 1:08 AM
tomek requested changes to this revision.Aug 3 2022, 8:20 AM
tomek added inline comments.
web/babel.config.cjs
17 ↗(On Diff #15209)

One thing to check here is if we really should use node as a target. Maybe we should instead use something browser-specific https://babeljs.io/docs/en/options#targets? It might be also the case that keeping node here is a good thing.

So please check if after setting e.g. "targets": "> 0.25%, not dead" tests still work and running the web app is possible in both dev and prod modes.

This revision now requires changes to proceed.Aug 3 2022, 8:20 AM

Add browser target. Since we use ssr I figured the node target should
probably stay as well

Remove browser from targets

tomek added inline comments.
web/babel.config.cjs
17 ↗(On Diff #15209)

My comment was a bit confusing. Having just the node is fine because this is a config for the test env.

This revision is now accepted and ready to land.Aug 4 2022, 6:32 AM
This revision was automatically updated to reflect the committed changes.