[HN Gopher] Meta Is Transferring Jest to the OpenJS Foundation
       ___________________________________________________________________
        
       Meta Is Transferring Jest to the OpenJS Foundation
        
       Author : jimmy2020
       Score  : 207 points
       Date   : 2022-05-11 16:42 UTC (6 hours ago)
        
 (HTM) web link (engineering.fb.com)
 (TXT) w3m dump (engineering.fb.com)
        
       | jvalencia wrote:
       | Me putting my cynic's hat on, I wonder if Meta is trying to
       | offload as much responsibility given recent belt-tightening?
        
         | vjeux wrote:
         | I've been involved in making this move happen and it has been
         | many months in the process and was many years overdue. The two
         | events, at least from my perspective, are unrelated.
        
           | jimmy2020 wrote:
           | Does Meta contribute financially to the foundation?
        
             | rickhanlonii wrote:
             | Meta is a backer of the Linux Foundation which OpenJS is a
             | part of and has donated $22,000 to the Jest Open Collective
             | which was created by Meta in 2016 to support non-employee
             | Jest contributors. Jest actually has all the funds we need
             | right now and our bigger issue is finding ways to spend it!
        
               | [deleted]
        
               | lloydatkinson wrote:
               | Is that it? Facebook is a huge corporation, that must
               | have React app after React app using Jest, and they are
               | paying volunteers to work on it now? With a fraction of
               | what a single developers average salary is?
        
               | edgyquant wrote:
               | Facebook created jest dude, they've invested more than
               | that 26,000. That's also almost half of the total
               | donations.
        
               | MoSattler wrote:
               | I didn't know they had so little donations. It's a super
               | important building block of the industry, and yet the
               | industry doesn't even pay a single developers salary for
               | it?
        
               | theptip wrote:
               | Facebook built this, with engineers that they were paying
               | a salary to. It's 100% industry-funded.
        
               | samhw wrote:
               | I think they meant 'the rest of the industry'?
        
               | rickhanlonii wrote:
               | We don't really need the funds and can't spent the ones
               | we have, so we haven't pushed for more donations over the
               | years.
        
               | joshmanders wrote:
               | You're vastly ignoring the fact that Meta paid full time
               | salaries for developers who worked exclusively on it for
               | years.
               | 
               | Overall their financial contributions could be in the
               | millions. Don't think about the small amount they've done
               | recently.
        
               | rickhanlonii wrote:
               | From Jest's perspective, that amount is way over what
               | we've needed to date.
        
               | seattle_spring wrote:
               | I really dislike the attitude of complaining that someone
               | hasn't given "enough", especially when they've already
               | given more than almost anyone else.
        
               | Kaze404 wrote:
               | This isn't some_one_, it's some_thing_. I share your
               | sentiment when it comes to individuals but extending the
               | same sympathy to a company, especially one the size of
               | Facebook, doesn't make sense imo.
        
               | samhw wrote:
               | It's not a question of 'sympathy', it's a question of
               | recognising the neutral fact that a company providing its
               | code to you free of charge is not further obligated -
               | irrespective of whether you happen to like or dislike
               | that company - to spend what you deem to be an
               | 'appropriate' amount on maintaining the free software
               | they provide you.
               | 
               | (And, even if any of the foregoing made any sense, the
               | notion that an 'appropriate' amount is somehow measured
               | relative to the company's revenue, rather than the
               | factual costs of maintaining the software, is
               | disqualifyingly silly in its own right.)
        
               | [deleted]
        
               | lloydatkinson wrote:
               | This isn't some random small library. It is/was a library
               | developed by a FAANG company that underpins a large part
               | of the JS ecosystem that they were paying their full time
               | employees to work on.
        
               | samhw wrote:
               | They are providing their code to you free of charge. They
               | are _already_ doing you a kindness. So certainly they are
               | under no obligation to spend $22k, let alone more than
               | that. Christ, attitudes towards open source have become
               | seriously warped over the last few years.
        
               | lloydatkinson wrote:
               | And? They were presumably paying at one point their own
               | developers full time salaries while working on Jest and
               | now Jest has been cast off to somewhere else and suddenly
               | any expected future contributors deserve, in comparison,
               | pennies? All while still using Jest themselves
               | internally.
        
               | gowld wrote:
               | > any expected future contributors
               | 
               | no such thing
        
               | cute_boi wrote:
               | Well, they are also benefitting from it, right? Its a
               | symbiotic relationship. They get huge marketing PR from
               | it.
               | 
               | Billionaire also donates million of dollars....
        
               | woodruffw wrote:
               | I will point out, as an open source maintainer: someone
               | giving you code "free of charge" is the same thing as
               | them giving you a free puppy: everybody loves puppies,
               | but they are absolutely _not_ free to maintain.
               | 
               | This isn't meant to imply that Meta is, _in this
               | instance_ , offloading costs onto the community. But it's
               | a tried-and-true tradition.
        
               | samhw wrote:
               | A white elephant, basically, you mean? I definitely
               | understand that, but I'm not sure it applies here. Jest
               | and React are exceptionally mature and well-maintained
               | pieces of software. Many a startup has been built by
               | gluing React to Express and Postgres with nary a glimmer
               | of skill required. Hell, it has its own developer tools
               | built into Chrome.
        
               | woodruffw wrote:
               | The pernicious thing about "mature and well-maintained"
               | pieces of software is that their maintenance becomes
               | bursty: they don't need anything for years, until
               | something needs changing/fixing _this instant_.
               | 
               | Log4j is the canonical example of this: it's such a
               | boring piece of substrate that nobody noticed that it was
               | effectively maintained by one person and had grown all
               | kinds of configurable knobs and dials over the years.
               | 
               | Ultimately, I'm not saying that Meta is in the wrong
               | here. But "here's a cash infusion with no long-term
               | funding or staff commitment" is the kind of general
               | mispattern that we're seeing w/r/t corporate open source.
        
             | vjeux wrote:
             | Meta has contributed $22k to the Jest open collective which
             | currently sits at $65k. https://opencollective.com/jest
        
         | duxup wrote:
         | I don't know.
         | 
         | But even if that was the case is it cynical or just the right
         | thing to do if you've got fewer resources?
        
       | rickhanlonii wrote:
       | I started as a Jest core contributor before joining Meta. It's
       | arguably the reason I work there now, and I'm really excited for
       | the move.
       | 
       | Meta created Jest and a lot of the features that it's known for,
       | but it's true that it hasn't been invested in for a few years and
       | most of the recent features were created by the community.
       | 
       | With this move, Meta is showing their commitment to Open Source
       | and Jest will be able to grow with ownership through the OpenJS
       | Foundation led by the Jest core team and the Jest community.
        
         | orta wrote:
         | Thanks for putting in the time to make this work from Meta's
         | side! Us folks on the outside appreciate it a bunch
        
         | nickstinemates wrote:
         | Reads kind of like an obituary.
        
         | jimmy2020 wrote:
         | Is Meta moving away from Jest or is it still used internally?
        
           | rickhanlonii wrote:
           | Yeah, Meta will continue to use Jest internally. It still
           | works really well for us, it's just "feature complete" for
           | our use cases so we haven't needed to invest in it.
        
             | ramesh31 wrote:
             | >Yeah, Meta will continue to use Jest internally. It still
             | works really well for us, it's just "feature complete" for
             | our use cases so we haven't needed to invest in it.
             | 
             | What's the status of Rome? Is that being looked at as a
             | long term replacement?
        
               | zpao wrote:
               | Rome is a completely separate project that Meta no longer
               | owns. You can check https://rome.tools/ for the project
               | status.
        
       | jdorfman wrote:
       | Good. Next should be React.
        
         | oceanswave wrote:
         | But next is already react _smirk_
        
           | jdorfman wrote:
           | haha. Yeah but still Next, like React is run by a company,
           | which means a small group sets the priorities.
        
         | jimmy2020 wrote:
         | Do you think React will survive without Meta?
        
           | gherkinnn wrote:
           | Vue survives just fine.
           | 
           | Sure, its market share is lower, but the quality of Vue 3 is
           | on par with React. Most impressively, it comes with its own
           | core libraries for routing [0] and state [1]. And by
           | extension, has spawned library agnostic tooling in the form
           | of Vite [2] and now Vitest. [3]
           | 
           | 0 - https://router.vuejs.org/
           | 
           | 1 - https://pinia.vuejs.org/
           | 
           | 2 - https://vitejs.dev/
           | 
           | 3 - https://vitest.dev/
        
             | nsonha wrote:
             | react also survivED just fine, but they will die
             | eventually, and because of the nature of front end
             | development, it will happen faster than typical software
             | project. It doesn't help that most veteran web devs hate
             | react (vs the platform).
        
           | k__ wrote:
           | There are projects with smaller communities than React that
           | do pretty well.
        
             | jimmy2020 wrote:
             | I know. But it's not just about the community it's more
             | about the commitment and consistency.
        
               | TAForObvReasons wrote:
               | There are smaller projects not backed by a large tech
               | company that arguably have more commitment and
               | consistency.
        
           | jdorfman wrote:
           | > Do you think React will survive without Meta?
           | 
           | I do. The ecosystem is strong and if handed over to a
           | foundation like the OpenJS Foundation it has a better chance
           | of evolving. From my perspective, React is what FB/Meta
           | needs, not necessarily what the community wants. There is no
           | oversight or governance which is concerning given that many
           | developers make a living off of React.
           | 
           | For an expanded explanation see YouTube/KTQVBXb0uPM?t=328
        
       | azangru wrote:
       | If only it could speed up whatever it is in the Node project that
       | is blocking Jest's adoption of ES modules, including their
       | mocking :-(
        
         | edgyquant wrote:
         | Yeah coming from python and pytest jest has been a real
         | struggle to get right.
        
           | azangru wrote:
           | Heh, when I tried pytest, I thought how much simpler things
           | are when writing tests with jest.
        
             | edgyquant wrote:
             | Yeah I guess it comes down to what you're used to
        
       | bennettdams wrote:
       | Facebook stopped actively maintaining Jest months (years?) ago,
       | so this is a good move for the community.
       | 
       | See this old HN thread:
       | 
       | https://news.ycombinator.com/item?id=30168241
       | 
       | ..and the comment from the "only" remaining maintainer:
       | 
       | https://github.com/facebook/jest/pull/11529#issuecomment-102...
        
         | [deleted]
        
       | debug-desperado wrote:
       | Is that like the Apache graveyard but for node projects?
        
       | szundi wrote:
       | Maybe related to the engineer hiring freeze
        
       | jmull wrote:
       | If I know mocha is there any reason I should learn and use jest?
       | 
       | (outside of a React project)
        
         | no_wizard wrote:
         | If you don't plan on using it in the browser, it has everything
         | Mocha does and doesn't, like built in expect functions (mocha
         | only provides the runner infrastructure).
         | 
         | Its also, as of late, really shown some innovation around
         | testing, I think Jest 28 is a huge step in the right direction.
         | 
         | The only other fully fledged alternative I can think of is
         | Jasmine (which, iirc Jest is actually a fork of?) but Jasmine
         | isn't as well maintained and has no transform infrastructure.
         | 
         | Basically, unless you're just really happy with mocha, I think
         | Jest gives you more flexibility, especially as projects /
         | products grow overtime.
         | 
         | Jest is also better in monorepos IMO.
        
         | FinalBriefing wrote:
         | I found it to be fast and easy to set up. I reviewed a number
         | of testing frameworks for vanilla JS projects, and it came up
         | on top, even though I hoped it wouldn't (I try to avoid all
         | Facebook products).
         | 
         | I can't remember the specifics, but I think it was a mix of
         | having nice reporting built in, easy to spy on or mock our
         | ESModules, and there are a lot of other developers using it, so
         | it was easy to find solutions.
         | 
         | It mostly "just worked" and didn't require adding other
         | libraries to handle mocks and spies.
        
       | skybrian wrote:
       | Off-topic but maybe here will knows:
       | 
       | I like to use simpler tools, so I'm wondering if there's a more
       | stripped down test tool, sort of like Preact versus React?
       | 
       | For node-based testing I like Ava, but is there a simple tool for
       | browser-based testing?
        
         | koshergweilo wrote:
         | Depending on your stack vitest is pretty straightforward
        
       | cute_boi wrote:
       | Wasn't facebook asking donations for Jest despite being billion
       | dollar company? Couldn't facebook fund the development of Jest
       | instead of asking donations.
       | 
       | (P.S. I don't know full story but 2 years ago I used to see
       | sponsor button on opencollective for Jest. And, the repo actively
       | mentioned jest is owned by facebook)9
        
       | bilalq wrote:
       | Jest has been pretty wonderful to work with over the last few
       | years. Like any test framework, however, there are real pain
       | points.
       | 
       | I've recently started experimenting with Vitest on a new webapp
       | using Vite/React. It's API compatible with Jest, but integrates
       | with your existing build tool-chain instead of forcing you to
       | configure a parallel one. So far, there's a lot to like.
       | https://vitest.dev/
       | 
       | The `--ui` flag showing a visualization of the dependency graph
       | of a test is probably my favorite little feature.
        
         | yboris wrote:
         | +1 for vitest & _vite_ -- used both as the foundation when
         | porting over a few custom elements and it 's a pleasure working
         | with them. Migrating tests from Jest to vitest required almost
         | no changes.
        
         | _fat_santa wrote:
         | I've been leading the adoption of vitest at my company. It's
         | not perfect, and there are some bugs but the performance gain
         | is truly incredible. We have about 150 snapshots for various UI
         | components and vitest can crunch through all of them in about 5
         | seconds, whereas it would take Jest 3-4X that time.
         | 
         | It's also nice if you're running a "vite stack", you don't have
         | to pull in babel and a bunch of other libs just to make Jest
         | work.
        
           | matsemann wrote:
           | Do you feel the snapshot tests are useful? I've mostly had
           | bad experiences with them (mostly noise), so interested in
           | hearing what makes them work for you/others.
        
           | aidos wrote:
           | That's awesome news. Started looking it integrating jest
           | today but we use vite, so this is a very timely post!
        
         | throwanem wrote:
         | Can you use Vitest without Vite? It looks cool, I'd love to
         | know more.
        
           | kasbah wrote:
           | I'm pretty sure you can. Though I haven't tried it myself I
           | did a search if we could integrate it into our Next.js app
           | (Next uses Webpack internally) and found this:
           | https://github.com/elpnt/nextjs-vitest-example
        
       | lloydatkinson wrote:
       | We will have to wait a while to see where this leads. I hope it
       | goes well but I am worried. I have started using Vitest on
       | projects where I can recently anyway. For a very very long time
       | Jest was holding up unit testing support for Vite to where point
       | that someone else developed Vitest in the meantime.
        
       ___________________________________________________________________
       (page generated 2022-05-11 23:00 UTC)