2 ms·
jsdom is great, I have nothing but respect and admiration for its developers. But ultimately, it's not a very good representation of how browser implementation
by draw_down 11y ago
jsdom is great, I have nothing but respect and admiration for its developers. But ultimately, it's not a very good representation of how browser implementations of the DOM really behave, and it's quite lax about letting you do things that won't work in browsers. So often your tests just end up testing that your code works in jsdom. Phantomjs has its own issues but is at least based on a real browser engine.
There are some nice tools that allow you to pipe JS to them for execution. For jsdom, there's jsdom-eval, and for phantom there's ghostface.
Lastly, I don't think there's much point casting about for the exact right assertion library or test harness framework. The important thing is the environment your tests run in, and how your tests are written of course. It doesn't matter if you're calling `assert(realValue, expectedValue)` or `expect(realValue).toBe(expectedValue)`, etc.