2 QUnit
.module( 'mediawiki.api.parse', QUnit
.newMwEnvironment( {
4 this.clock
= this.sandbox
.useFakeTimers();
5 this.server
= this.sandbox
.useFakeServer();
7 teardown: function () {
12 QUnit
.test( 'Hello world', function ( assert
) {
15 var api
= new mw
.Api();
17 api
.parse( '\'\'\'Hello world\'\'\'' ).done( function ( html
) {
18 assert
.equal( html
, '<p><b>Hello world</b></p>' );
21 this.server
.respondWith( /action=parse.*&text='''Hello\+world'''/, function ( request
) {
22 request
.respond( 200, { 'Content-Type': 'application/json' },
23 '{ "parse": { "text": { "*": "<p><b>Hello world</b></p>" } } }'
27 this.server
.respond();