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)
Wed, Nov 27, 10:50 PM
Unknown Object (File)
Wed, Nov 27, 12:48 AM
Unknown Object (File)
Tue, Nov 26, 11:33 PM
Unknown Object (File)
Tue, Nov 26, 9:47 PM
Unknown Object (File)
Thu, Nov 21, 5:39 AM
Unknown Object (File)
Thu, Nov 21, 5:39 AM
Unknown Object (File)
Thu, Nov 21, 5:39 AM
Unknown Object (File)
Thu, Nov 21, 5:39 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
No Lint Coverage
Unit
No Test Coverage

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

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.