Make it work with current QUnit (2.9.2)
Opened this issue · 0 comments
meisl commented
Hi there :)
I know this project is somewhat outdated, but somehow I like the spirit of it.
Was wondering how much it'd take to bring it to QUnit 2.x, or even 3, when it comes out?
After all, pavlov is still mentioned on QUnit's plugins page - as the second entry! Yet it relies on QUnit 1.9...
Main things I see:
- cannot use QUnit globals 'assert', 'ok' etc anymore
- actually: there shouldn't be such a thing as exposed globals in pavlov either!
- even (not) if only "by trickery": the
extendScope
hack, which creates the illusion of globaldescribe
,it
,assert
etc. has to go. That's pretty obvious to me, but I can explain why if you want me to (Metaprogramming as such is fine, but you can't do it like that, and not here). - there's an easy alternative to this: simply pass all of them as arguments to
pavlov.specify
. The user then - we have ES6 now - just has to say once:pavlov.specify("foo", ({describe, before, after, it, assert}) => { ... })
. This would help minimize necessary changes to existing specs.
I'd give it a try in a fork, if anyone's interested..?