Hacker News new | ask | show | jobs
by tkzed49 321 days ago
assertions in node test feel very "technically correct but kind of ugly" compared to jest, but I'll use it anyway
1 comments

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)
                })
            );