2 QUnit.module( 'mediawiki.api.messages', QUnit.newMwEnvironment( {
4 this.server = this.sandbox.useFakeServer();
5 this.server.respondImmediately = true;
9 QUnit.test( '.getMessages()', 1, function ( assert ) {
10 this.server.respondWith( /ammessages=foo%7Cbaz/, [
12 { 'Content-Type': 'application/json' },
13 '{ "query": { "allmessages": [' +
14 '{ "name": "foo", "content": "Foo bar" },' +
15 '{ "name": "baz", "content": "Baz Quux" }' +
19 return new mw.Api().getMessages( [ 'foo', 'baz' ] ).then( function ( messages ) {