Re:Modern Node.js Patterns
by tkzed49 on Sunday August 03, 2025 @05:34PM
(#44780028)
assertions in node test feel very "technically correct but kind of ugly" compared to jest, but I'll use it anyway
[ Parent
| on HN ]
yes but consider this Jest code, replicating such in node testing is painful. testing code should be DSL-like, should be very easy to read.
expect(bar).toEqual(
expect.objectContaining({
symbol: `BTC`,
interval: `hour`,
timestamp: expect.any(Number),
o: expect.any(Number),
h: expect.any(Number),
l: expect.any(Number),
c: expect.any(Number),
v: expect.any(Number)
})
);