3 QUnit
.module( 'mediawiki.inspect' );
5 QUnit
.test( '.getModuleSize() - scripts', function ( assert
) {
8 function () { 'example'; }
11 return mw
.loader
.using( 'test.inspect.script' ).then( function () {
13 mw
.inspect
.getModuleSize( 'test.inspect.script' ),
14 // name, script function
21 QUnit
.test( '.getModuleSize() - scripts, styles', function ( assert
) {
24 function () { 'example'; },
25 { css
: [ '.example {}' ] }
28 return mw
.loader
.using( 'test.inspect.both' ).then( function () {
30 mw
.inspect
.getModuleSize( 'test.inspect.both' ),
31 // name, script function, styles object
38 QUnit
.test( '.getModuleSize() - scripts, messages', function ( assert
) {
40 'test.inspect.scriptmsg',
41 function () { 'example'; },
43 { example
: 'Hello world.' }
46 return mw
.loader
.using( 'test.inspect.scriptmsg' ).then( function () {
48 mw
.inspect
.getModuleSize( 'test.inspect.scriptmsg' ),
49 // name, script function, empty styles object, messages object
51 'test.inspect.scriptmsg'
56 QUnit
.test( '.getModuleSize() - scripts, styles, messages, templates', function ( assert
) {
59 function () { 'example'; },
60 { css
: [ '.example {}' ] },
61 { example
: 'Hello world.' },
62 { 'example.html': '<p>Hello world.<p>' }
65 return mw
.loader
.using( 'test.inspect.all' ).then( function () {
67 mw
.inspect
.getModuleSize( 'test.inspect.all' ),
68 // name, script function, styles object, messages object, templates object