From: Timo Tijhof Date: Tue, 24 Nov 2015 20:06:52 +0000 (+0000) Subject: Add unit tests for mw.format() X-Git-Tag: 1.31.0-rc.0~8882^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=843a444b68d671ca19dfbffb77fb14a34ca4fa41;p=lhc%2Fweb%2Fwiklou.git Add unit tests for mw.format() Follows-up ec285f442, 00f6574. Change-Id: Ic3ff05c0f48bd6101361312af70ca2b2c52ef79a --- diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js index d205ba7438..f7c8d17e2a 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js @@ -57,6 +57,19 @@ this.restoreWarnings(); } ); + QUnit.test( 'mw.format', 2, function ( assert ) { + assert.equal( + mw.format( 'Format $1 $2', 'foo', 'bar' ), + 'Format foo bar', + 'Simple parameters' + ); + assert.equal( + mw.format( 'Format $1 $2' ), + 'Format $1 $2', + 'Missing parameters' + ); + } ); + QUnit.test( 'mw.Map', 35, function ( assert ) { var arry, conf, funky, globalConf, nummy, someValues;