kvendrik/jest-lite

Use Jest-Lite to create a Jest Cookbook

Opened this issue · 5 comments

orta commented

These were my first mockups I made during the redesign last year, I only really showed them at the Jest core summit as rough drafts, so they're not polished.

Generally cookbooks are a sort of mini reference for how to do specific things, it'd be nice to have a static SEOable page for common questions about using Jest and statically generated cookbook could do that.

Screen Shot 2019-07-17 at 10 39 01 PM

Screen Shot 2019-07-17 at 10 39 16 PM

The core concept being:

  • Each example is in the form I want to "x" a "y" which "z"
    Screen Shot 2019-07-17 at 10 41 26 PM

  • Each example has a corresponding GitHub issue, where people can leave their feedback (using something like this)

  • Ideally, each example could have a virtual fs (for showing import/exports)

  • There is the very well commented Jest API on definitely typed which can make working with the editor easier

Love this ❤️. I feel like it could really help people figure out how to get started with testing (and perhaps even with advanced testing patterns).

What gave you the idea? I'm curious to learn more about how people currently get this information and where the cookbook would fit in.

I'm guessing you addressed some of that in your talk? Do you have a link to it?

orta commented

It wasn't a talk, it was just where we all came together to chat.

There's a form of learning by doing called TDD katas, you start with red tests and then learn how something works by making it green.

Ideally the cookbook offers people a space where they can have a working version, then break it to understand how the pieces come together in a crafted environment.

These mockups were more focused on examples of existing sorts of questions people had asked inside the last company I worked at. With the goal being that they'd hit these in search results. The JS reference for Jest covers what all the pieces are, but doesn't necessarily cover how they come together

Makes a lot of sense. Do you think this should be part of the Jest website?

I'm thinking that we might be able to break this down into two steps by, first, adding a playground to the website in which you can play around with Jest, simular to what TypeScript has, and then adding examples (or presets?) to it that each have a cookbook-y title and are SEO-friendly.

We could then also add the Tips & Tricks section to it somehow. Not sure how this would work though, maybe it would just be a hard coded list of URLs that people change by opening a PR in the repo? Also not sure what the best form for this would be, I think if we want this to be part of the Jest website the team will probably have some opinions on this.

orta commented

Yep, a part of the jest website - first building out a playground makes a lot of sense and then this sort of thing can live on top of that

@orta created an issue in the Jest repo to get the team's thoughts on our playground idea. I have a feeling it might have come up before, curious to hear what they think and if they have certain ideas/opinions on this.