mediawiki-extensions-Visual.../modules/ve-mw/tests/dm/ve.dm.Converter.test.js
Thiemo Kreuz 346216c050 Update more test code to use ES6 syntax
This patch is mostly about the arrow syntax.

Some places can not be updated because the arrow syntax also
changes the meaning of `this.…`, but some code relies on that.

Change-Id: Ida3ab0e0950a428fbd1a85f281013778ee879df4
2021-04-30 10:08:45 +00:00

35 lines
896 B
JavaScript

/*!
* VisualEditor DataModel MediaWiki-specific Converter tests.
*
* @copyright 2011-2020 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
QUnit.module( 've.dm.Converter (MW)', ve.test.utils.mwEnvironment );
QUnit.test( 'getModelFromDom', ( assert ) => {
const cases = ve.dm.mwExample.domToDataCases;
for ( const msg in cases ) {
const caseItem = ve.copy( cases[ msg ] );
if ( caseItem.mwConfig ) {
mw.config.set( caseItem.mwConfig );
}
ve.test.utils.runGetModelFromDomTest( assert, caseItem, msg );
}
} );
QUnit.test( 'getDomFromModel', ( assert ) => {
const cases = ve.dm.mwExample.domToDataCases;
for ( const msg in cases ) {
const caseItem = ve.copy( cases[ msg ] );
if ( caseItem.mwConfig ) {
mw.config.set( caseItem.mwConfig );
}
ve.test.utils.runGetDomFromModelTest( assert, caseItem, msg );
}
} );