eslint: Use in all folders (including tests/selenium)

Change-Id: I0ab0a9f99817077934e7569d19d76735c33678e9
This commit is contained in:
Ed Sanders 2018-11-12 16:21:34 +00:00
parent 3986634d8a
commit cf33c80b98
3 changed files with 28 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* eslint-env node */
/* eslint-env node, es6 */
module.exports = function ( grunt ) {
var conf = grunt.file.readJSON( 'extension.json' );
@ -34,8 +34,7 @@ module.exports = function ( grunt ) {
},
eslint: {
all: [
'*.js',
'modules/**/*.js',
'**/*.js',
'!**/node_modules/**',
'!vendor/**'
]

View File

@ -0,0 +1,14 @@
{
"env": {
"es6": true,
"mocha": true,
"node": true,
"browser": false
},
"globals": {
"browser": false
},
"rules":{
"no-console": 0
}
}

View File

@ -1,26 +1,25 @@
'use strict';
const assert = require('assert'),
Api = require('wdio-mediawiki/Api'),
MathPage = require('../pageobjects/math.page');
const assert = require( 'assert' ),
Api = require( 'wdio-mediawiki/Api' ),
MathPage = require( '../pageobjects/math.page' );
describe( 'Math', function () {
describe('Math', function () {
it('should work for addition', function () {
it( 'should work for addition', function () {
// page should have random name
var pageName = Math.random().toString();
// create a page with a simple addition
browser.call(function () {
return Api.edit(pageName, '<math>3 + 2</math>');
});
browser.call( function () {
return Api.edit( pageName, '<math>3 + 2</math>' );
} );
MathPage.openTitle(pageName);
MathPage.openTitle( pageName );
// check if the page displays the image
assert(MathPage.img.isExisting());
assert( MathPage.img.isExisting() );
});
} );
});
} );