raiderrobert,
@raiderrobert@mastodon.social avatar

I apologize ahead of time for the wall of text.

It’s a meme at this point about the rate of change in $frontend with the various #JS libraries.

I wanted to spend some time to understand why https://bun.sh appears to be all the rage.

But first I spent some time this week to figure out what the state of testing is—specifically for #React.

raiderrobert,
@raiderrobert@mastodon.social avatar

I wrote a really simple #React component that has logic inside of it. (Yes, I know that should be factored out, but it’s a toy example. So hush.)

raiderrobert,
@raiderrobert@mastodon.social avatar

I wrote a pair of tests. One that’s sanity check, and another that’s a parameterized test for each of the expected outcomes.

raiderrobert,
@raiderrobert@mastodon.social avatar

I’m going to complain now for a bit, so buckle up.

This seems fine, but I’m also vaguely disappointed.

I initially went back to Enyzme before figuring out that it seems to be largely community deprecated, and I should be using instead the “react-testing-library”. That took me a couple of times to grok.

So fine, let’s use the “react-testing-library”.

raiderrobert,
@raiderrobert@mastodon.social avatar

More boiler plate and configs than expected.
The relatively few examples was surprising: https://testing-library.com/docs/recipes
The lack of something as simple as a hello world component and test was surprising.

raiderrobert,
@raiderrobert@mastodon.social avatar

The way these docs appear to mostly want to justify their decisions and give an FAQ before dropping you into their Core API was kind of strange.

raiderrobert,
@raiderrobert@mastodon.social avatar

I’m left wondering if I’m missing something. If there’s another library that is “the way” instead….but the 18k Github stars suggest no. This is the way.

raiderrobert,
@raiderrobert@mastodon.social avatar

So yeah, can someone in the #javascript / #js / #React ecosystem tell me if I’m missing another more popular library that has a lot of great examples? Because this felt a little weird to me.

keithjgrant,
@keithjgrant@front-end.social avatar

@raiderrobert sigh Yeah, RTL is the testing lib in the React world, and that makes me very sad. Primarily b/c it’s all integration tests and absolutely no unit tests

On my team, we’re taking a chance on the new Cypress component testing stuff, but we’re yet to see how that pans out in the long term

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming
  • DreamBathrooms
  • ngwrru68w68
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • tacticalgear
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • ethstaker
  • JUstTest
  • GTA5RPClips
  • modclub
  • tester
  • provamag3
  • osvaldo12
  • cisconetworking
  • everett
  • cubers
  • normalnudes
  • megavids
  • Leos
  • anitta
  • lostlight
  • All magazines