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 | + |
2 | 6 | window.mw.loader.testCallback = function() { |
3 | 7 | start(); |
4 | 8 | 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 @@ |
73 | 73 | |
74 | 74 | |
75 | 75 | require( './testrunner.js' ); |
76 | | -require( './defineTestCallback.js' ); |
77 | 76 | |
78 | 77 | // jQuery might have been extended by the above requires. |
79 | 78 | // So we have to reinit the $ shortcut: |
Index: branches/hashar/node-qunit/tests/qunit/suites/resources/mediawiki/mediawiki.js |
— | — | @@ -124,12 +124,12 @@ |
125 | 125 | }); |
126 | 126 | |
127 | 127 | test( 'mw.loader', function() { |
128 | | - expect(4); |
| 128 | + expect(5); |
129 | 129 | |
130 | 130 | // Regular expression to extract the path for the QUnit tests |
131 | 131 | // Takes into account that tests could be run from a file:// URL |
132 | 132 | // by excluding the 'index.html' part from the URL |
133 | | - var rePath = /(?:[^#\?](?!index.html))*\/?/; |
| 133 | + var rePath = /(?:[^#\?](?!index.html|data\/node-bootstrap.js))*\/?/; |
134 | 134 | |
135 | 135 | // Four assertions to test the above regular expression: |
136 | 136 | equal( |
— | — | @@ -152,17 +152,16 @@ |
153 | 153 | "file://path/to/tests/", |
154 | 154 | "Extracting path from local URL (file://) with fragment" |
155 | 155 | ); |
156 | | -/* FIXME BROKEN UNDER NODE-QUNIT |
157 | 156 | // Asynchronous ahead |
158 | 157 | stop(5000); |
159 | 158 | |
| 159 | + // FIXME: this test does not work under nodejs qunit |
| 160 | + |
160 | 161 | // Extract path |
161 | 162 | var tests_path = rePath.exec( document.location.href ); |
162 | | - |
163 | 163 | mw.loader.implement( 'is.awesome', [QUnit.fixurl( tests_path + 'data/defineTestCallback.js')], {}, {} ); |
164 | 164 | |
165 | 165 | mw.loader.using( 'is.awesome', function() { |
166 | | - |
167 | 166 | // /sample/awesome.js declares the "mw.loader.testCallback" function |
168 | 167 | // which contains a call to start() and ok() |
169 | 168 | mw.loader.testCallback(); |
— | — | @@ -172,11 +171,9 @@ |
173 | 172 | start(); |
174 | 173 | ok( false, 'Error callback fired while implementing "is.awesome" module' ); |
175 | 174 | }); |
176 | | -*/ |
177 | 175 | }); |
178 | 176 | |
179 | 177 | test( 'mw.loader.bug29107' , function() { |
180 | | - /* FIXME BROKEN UNDER NODE-QUNIT |
181 | 178 | expect(2); |
182 | 179 | |
183 | 180 | // Message doesn't exist already |
— | — | @@ -194,7 +191,6 @@ |
195 | 192 | start(); |
196 | 193 | ok( false, 'Error callback fired while implementing "bug29107.messages-only" module' ); |
197 | 194 | }); |
198 | | - */ |
199 | 195 | }); |
200 | 196 | |
201 | 197 | test( 'mw.html', function() { |