4 ms·
I'm not this is really an alternative, at least a direct alternative, to Jest. Jest is much larger - but you get a LOT more functionality, so this isn't really
by lmiller1990 7y ago
I'm not this is really an alternative, at least a direct alternative, to Jest. Jest is much larger - but you get a LOT more functionality, so this isn't really surprising. You don't just get a test runner, you can a fully fledged testing environment.
I haven't found Jest to be a bottleneck at all, but all the other stuff (transpiling TS, rendering a DOM for React component tests, etc...). Jest supports all this out of the box, more or less, or with a few plugins - baretest doesn't. I guess you have to configure external libraries (jsdom, webpack, babel?) to do this with baretest. Now your tests are slow, like in Jest! Turns out the test runner isn't the bottleneck, but all the other stuff that happens before the actual execution.
Some real benchmarks would make this article much more convincing - and not just with a basic "sum" function, but various examples (some simple node tests, some API tests, some jsdom tests...)
I don't think baretest or minimalist libraries are bad, but I also don't think anyone using Jest could really consider this an alternative, unless your use case is very simple.
- jessaustin 7y agoI doubt that most users of complicated test tools are using most of the features of those tools.
- volument 7y agoGood points. Just want to point out that comparing with a basic "sum" function measures the performance of the test runner and leaves out the time it takes to run the application code. Baretest has little overhead so it is good for testing the actively developed code with the `only` function. With Baretest all the custom things you do like transpiling TS or rendering React is done outside the test runner. This way it can test cases of any complexity.
- lmiller1990 7y agoIn that case, will this really cut down on time to see the test result? Won't I have to trigger my TS/React build, then run the test (two separate actions, difficult to automate this). Again, I like simple... but it seems like to move from Jest to baretest I'd be giving up a lot, in terms of both features and time from saving my file to seeing the test result.