2 QUnit.module( 'mediawiki.api.parse', QUnit.newMwEnvironment( {
4 this.server = this.sandbox.useFakeServer();
8 QUnit.test( 'Hello world', function ( assert ) {
11 var api = new mw.Api();
13 api.parse( '\'\'\'Hello world\'\'\'' ).done( function ( html ) {
14 assert.equal( html, '<p><b>Hello world</b></p>' );
17 this.server.respondWith( /action=parse.*&text='''Hello\+world'''/, function ( request ) {
18 request.respond( 200, { 'Content-Type': 'application/json' },
19 '{ "parse": { "text": { "*": "<p><b>Hello world</b></p>" } } }'
23 this.server.respond();