fluid-tech IRC Logs-2012-09-24
[15:19:28 CDT(-0500)] <Bosmon> yura and I are talking about his "require stub" work in order to get browser test cases working in the GPII
[15:19:40 CDT(-0500)] <yura> Bosmon: yes we are
[15:19:52 CDT(-0500)] <Bosmon> Looking over the qunit source code, it appears you can disrupt its diabolic strategy by defining a global named "exports"
[15:19:58 CDT(-0500)] <Bosmon> It will then latch on to this rather than the true global object
[15:20:34 CDT(-0500)] <Bosmon> yura ran into an issue where the globals defined by qunit interfere with those used by when.js
[15:21:22 CDT(-0500)] <yura> Bosmon: could you point me to where in qunite i can do that ?
[15:21:42 CDT(-0500)] <yura> Bosmon: here's my hack https://github.com/GPII/universal/pull/52/files
[15:21:56 CDT(-0500)] <Bosmon> Hi yura - the code is at line 658 of qunit.js
[15:22:10 CDT(-0500)] <Bosmon> And then again at line 1961
[15:22:31 CDT(-0500)] <Bosmon> So if you just make sure that the "stub module system" constructs a fake "exports" before it loads qunit.js, the pollution will be averted
[15:23:29 CDT(-0500)] <yura> Bosmon: ok
[15:24:08 CDT(-0500)] <Bosmon> This "stub module system" might start looking more and more like a "real module system" : P
[15:30:38 CDT(-0500)] <Bosmon> But I guess it only ever needs to be good enough to load the modules that we want to run in test cases
[15:30:51 CDT(-0500)] <yura> Bosmon: i believe so
[15:31:10 CDT(-0500)] <yura> Bosmon: so like 658 might be different for me
[15:31:18 CDT(-0500)] <yura> is that from the source file in gpii
[15:31:19 CDT(-0500)] <yura> ?
[15:32:06 CDT(-0500)] <Bosmon> yura - this is the one in Infusion master
[15:32:14 CDT(-0500)] <Bosmon> You should take this opportunity to update qunit's version to this one
[15:32:16 CDT(-0500)] <Bosmon> Which is much more recent
[15:32:22 CDT(-0500)] <yura> ok
[15:32:36 CDT(-0500)] <yura> and jqunit too ?
[15:32:41 CDT(-0500)] <Bosmon> And it also coincides with one that it in qunit's own trunk
[15:32:53 CDT(-0500)] <Bosmon> yura - better leave jqunit for a while, since these have diverged a bit
[15:33:02 CDT(-0500)] <Bosmon> My actual plan was to update that the OTHER way round
[15:33:09 CDT(-0500)] <Bosmon> And have GPII's jqunit be the one we adopt in Infusion
[15:33:17 CDT(-0500)] <Bosmon> But that will mean rewriting every single Infusion test case
[15:33:41 CDT(-0500)] <yura> right
[15:34:07 CDT(-0500)] <Bosmon> But I think GPII's jqunit is a bit more rational and minimal
[15:34:19 CDT(-0500)] <Bosmon> And also folds in a lot of stuff which is just in our testUtils.js in Infusion
[15:34:31 CDT(-0500)] <Bosmon> As well as getting rid of all this malign "new TestCase" stuff
[15:34:56 CDT(-0500)] <yura> ok
[15:54:29 CDT(-0500)] <yura> Bosmon: there's one thing though, jqUnit would still need to use namespace qunit
[15:54:37 CDT(-0500)] <yura> rather than from window object
[15:55:05 CDT(-0500)] <Bosmon> yura that's correct, we would need to rewrite jqUnit
[15:55:22 CDT(-0500)] <yura> ok
[15:55:24 CDT(-0500)] <yura> that's fine
[15:55:29 CDT(-0500)] <Bosmon> cool
[16:13:32 CDT(-0500)] <yura> Bosmon: take a look when you have time https://github.com/GPII/universal/pull/52/files