r93166 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93165‎ | r93166 | r93167 >
Date:10:26, 26 July 2011
Author:hashar
Status:ok
Tags:
Comment:
defineTestCallback.js removed from bootstraping since it is meant to be loaded
by the ressource loader.
Makes loader test recognize node-qunit bootstraper
Re-enabled one async test (requires patch to node-qunit)
Modified paths:
  • /branches/hashar/node-qunit/tests/qunit/data/defineTestCallback.js (modified) (history)
  • /branches/hashar/node-qunit/tests/qunit/data/node-bootstrap.js (modified) (history)
  • /branches/hashar/node-qunit/tests/qunit/suites/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: branches/hashar/node-qunit/tests/qunit/data/defineTestCallback.js
@@ -1,3 +1,7 @@
 2+/**
 3+ * This file is loaded from a test using the ressource loader.
 4+ */
 5+
26 window.mw.loader.testCallback = function() {
37 start();
48 ok( true, 'Implementing a module, is the callback timed properly ?');
Index: branches/hashar/node-qunit/tests/qunit/data/node-bootstrap.js
@@ -72,7 +72,6 @@
7373
7474
7575 require( './testrunner.js' );
76 -require( './defineTestCallback.js' );
7776
7877 // jQuery might have been extended by the above requires.
7978 // So we have to reinit the $ shortcut:
Index: branches/hashar/node-qunit/tests/qunit/suites/resources/mediawiki/mediawiki.js
@@ -124,12 +124,12 @@
125125 });
126126
127127 test( 'mw.loader', function() {
128 - expect(4);
 128+ expect(5);
129129
130130 // Regular expression to extract the path for the QUnit tests
131131 // Takes into account that tests could be run from a file:// URL
132132 // by excluding the 'index.html' part from the URL
133 - var rePath = /(?:[^#\?](?!index.html))*\/?/;
 133+ var rePath = /(?:[^#\?](?!index.html|data\/node-bootstrap.js))*\/?/;
134134
135135 // Four assertions to test the above regular expression:
136136 equal(
@@ -152,17 +152,16 @@
153153 "file://path/to/tests/",
154154 "Extracting path from local URL (file://) with fragment"
155155 );
156 -/* FIXME BROKEN UNDER NODE-QUNIT
157156 // Asynchronous ahead
158157 stop(5000);
159158
 159+ // FIXME: this test does not work under nodejs qunit
 160+
160161 // Extract path
161162 var tests_path = rePath.exec( document.location.href );
162 -
163163 mw.loader.implement( 'is.awesome', [QUnit.fixurl( tests_path + 'data/defineTestCallback.js')], {}, {} );
164164
165165 mw.loader.using( 'is.awesome', function() {
166 -
167166 // /sample/awesome.js declares the "mw.loader.testCallback" function
168167 // which contains a call to start() and ok()
169168 mw.loader.testCallback();
@@ -172,11 +171,9 @@
173172 start();
174173 ok( false, 'Error callback fired while implementing "is.awesome" module' );
175174 });
176 -*/
177175 });
178176
179177 test( 'mw.loader.bug29107' , function() {
180 - /* FIXME BROKEN UNDER NODE-QUNIT
181178 expect(2);
182179
183180 // Message doesn't exist already
@@ -194,7 +191,6 @@
195192 start();
196193 ok( false, 'Error callback fired while implementing "bug29107.messages-only" module' );
197194 });
198 - */
199195 });
200196
201197 test( 'mw.html', function() {

Status & tagging log