eslint: Code style fixes for upcoming config change
Change-Id: Ief44c0bb26c5a1c1773cab5dba51d5e856612bf7
This commit is contained in:
parent
1205a64850
commit
d94f90e088
10 changed files with 19 additions and 21 deletions
|
|
@ -1,6 +1,6 @@
|
|||
var i, chars = [];
|
||||
const chars = [];
|
||||
|
||||
for ( i = 0; i <= 0x10ffff; i++ ) {
|
||||
for ( let i = 0; i <= 0x10ffff; i++ ) {
|
||||
chars.push( String.fromCodePoint( i ).toUpperCase() );
|
||||
}
|
||||
console.log( JSON.stringify( chars ) );
|
||||
|
|
|
|||
|
|
@ -33,18 +33,18 @@
|
|||
errorsuselocal: true,
|
||||
uselang: mw.config.get( 'wgUserLanguage' )
|
||||
} ).done( function ( resp ) {
|
||||
var pwinfo = resp.validatepassword,
|
||||
good = pwinfo.validity === 'Good',
|
||||
errors = [];
|
||||
var errors,
|
||||
pwinfo = resp.validatepassword,
|
||||
good = pwinfo.validity === 'Good';
|
||||
|
||||
currentApiPromise = undefined;
|
||||
|
||||
if ( !good ) {
|
||||
pwinfo.validitymessages.map( function ( m ) {
|
||||
errors.push( new OO.ui.HtmlSnippet( m.html ) );
|
||||
errors = pwinfo.validitymessages.map( function ( m ) {
|
||||
return new OO.ui.HtmlSnippet( m.html );
|
||||
} );
|
||||
}
|
||||
self.setErrors( errors );
|
||||
self.setErrors( errors || [] );
|
||||
d.resolve( good );
|
||||
} ).fail( d.reject );
|
||||
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@
|
|||
label: user.name
|
||||
} );
|
||||
}
|
||||
return undefined;
|
||||
} ).filter( function ( item ) {
|
||||
return item !== undefined;
|
||||
} );
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ describe( 'Backlinks', function () {
|
|||
describe( 'referrers', () => {
|
||||
it( 'can be listed', async () => {
|
||||
const result = await bob.list( 'backlinks', { bltitle: randomPage } );
|
||||
const links = result.map( ( p )=>( p.title ) );
|
||||
const links = result.map( ( p ) => p.title );
|
||||
assert.sameMembers( links, [ linksToEsther1, linksToEsther2 ] );
|
||||
} );
|
||||
} );
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ describe( 'Categories', function testCategories() {
|
|||
page
|
||||
);
|
||||
|
||||
return result[ page ].categories.map( ( p )=>utils.dbkey( p.title ) );
|
||||
return result[ page ].categories.map( ( p ) => utils.dbkey( p.title ) );
|
||||
};
|
||||
|
||||
const listMembers = async ( cat, param = {} ) => {
|
||||
|
|
@ -34,7 +34,7 @@ describe( 'Categories', function testCategories() {
|
|||
{ cmtitle: cat, ...param }
|
||||
);
|
||||
|
||||
return result.map( ( p )=>utils.dbkey( p.title ) );
|
||||
return result.map( ( p ) => utils.dbkey( p.title ) );
|
||||
};
|
||||
|
||||
it( 'can be added using wikitext syntax', async () => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const { action, assert, utils } = require( 'api-testing' );
|
||||
|
||||
describe( 'Links', function testLinks() {
|
||||
const titles = ( list ) => list.map( ( p )=>utils.dbkey( p.title ) );
|
||||
const titles = ( list ) => list.map( ( p ) => utils.dbkey( p.title ) );
|
||||
|
||||
const pageX = utils.title( 'LinkTest_X_' );
|
||||
const pageY = utils.title( 'LinkTest_Y_' );
|
||||
|
|
@ -54,7 +54,7 @@ describe( 'Links', function testLinks() {
|
|||
describe( 'to external pages', () => {
|
||||
it( 'can be listed', async () => {
|
||||
const result = await alice.prop( 'extlinks', pageX );
|
||||
const links = result[ pageX ].extlinks.map( ( p )=>p[ '*' ] );
|
||||
const links = result[ pageX ].extlinks.map( ( p ) => p[ '*' ] );
|
||||
|
||||
assert.sameMembers( links, [ urlY ] );
|
||||
} );
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ describe( 'Prefix Search', function () {
|
|||
|
||||
it( 'should search for pages with the `${prefix}` prefix', async () => {
|
||||
const result = await alice.list( 'prefixsearch', { pssearch: `${prefix}`, pslimit: 100 } );
|
||||
const pageTitles = result.map( ( p )=>utils.dbkey( p.title ) );
|
||||
const pageTitles = result.map( ( p ) => utils.dbkey( p.title ) );
|
||||
assert.sameMembers( pageTitles, [ firstPage, secondPage, thirdPage ] );
|
||||
} );
|
||||
} );
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ describe( 'User', function () {
|
|||
|
||||
// Disabled due to flakiness (T199446)
|
||||
it.skip( 'should be able to change preferences', function () {
|
||||
var realName = Util.getTestString();
|
||||
const realName = Util.getTestString();
|
||||
|
||||
// create
|
||||
browser.call( async () => {
|
||||
|
|
|
|||
|
|
@ -10,9 +10,7 @@ function getJobCount() {
|
|||
action: 'query',
|
||||
meta: 'siteinfo',
|
||||
siprop: 'statistics'
|
||||
} ).then( ( response ) => {
|
||||
return response.query.statistics.jobs;
|
||||
} );
|
||||
} ).then( ( response ) => response.query.statistics.jobs );
|
||||
}
|
||||
|
||||
function log( message ) {
|
||||
|
|
|
|||
|
|
@ -9,10 +9,9 @@ module.exports = {
|
|||
* @return {string} File path
|
||||
*/
|
||||
saveScreenshot( title ) {
|
||||
var filename, filePath;
|
||||
// Create sane file name for current test title
|
||||
filename = encodeURIComponent( title.replace( /\s+/g, '-' ) );
|
||||
filePath = `${browser.config.screenshotPath}/${filename}.png`;
|
||||
const filename = encodeURIComponent( title.replace( /\s+/g, '-' ) );
|
||||
const filePath = `${browser.config.screenshotPath}/${filename}.png`;
|
||||
// Ensure directory exists, based on WebDriverIO#saveScreenshotSync()
|
||||
try {
|
||||
fs.statSync( browser.config.screenshotPath );
|
||||
|
|
|
|||
Loading…
Reference in a new issue