2 QUnit.module( 'mediawiki.api.messages', QUnit.newMwEnvironment( {
4 this.server = this.sandbox.useFakeServer();
8 QUnit.test( '.getMessages()', function ( assert ) {
11 var api = new mw.Api();
12 api.getMessages( [ 'foo', 'baz' ] ).then( function ( messages ) {
22 this.server.respond( /ammessages=foo%7Cbaz/, [
24 { 'Content-Type': 'application/json' },
25 '{ "query": { "allmessages": [' +
26 '{ "name": "foo", "content": "Foo bar" },' +
27 '{ "name": "baz", "content": "Baz Quux" }' +