Move globals of test to a specific eslintrc file (#12959)

pull/12856/head^2
Rodrigo Nascimento 7 years ago committed by GitHub
parent d1b62112b6
commit 5b3ca5da17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .eslintrc
  2. 12
      tests/.eslintrc
  3. 2
      tests/data/checks.js
  4. 5
      tests/end-to-end/api/00-miscellaneous.js
  5. 7
      tests/end-to-end/api/01-users.js
  6. 12
      tests/end-to-end/api/02-channels.js
  7. 8
      tests/end-to-end/api/03-groups.js
  8. 9
      tests/end-to-end/api/04-direct-message.js
  9. 4
      tests/end-to-end/api/05-chat.js
  10. 8
      tests/end-to-end/api/06-outgoing-integrations.js
  11. 2
      tests/end-to-end/api/07-incoming-integrations.js
  12. 3
      tests/end-to-end/api/08-settings.js
  13. 3
      tests/end-to-end/api/09-rooms.js
  14. 3
      tests/end-to-end/api/10-subscriptions.js
  15. 2
      tests/end-to-end/api/11-graphql.js
  16. 3
      tests/end-to-end/api/11-permissions.js
  17. 3
      tests/end-to-end/api/12-emoji-custom.js
  18. 3
      tests/end-to-end/api/13-roles.js
  19. 4
      tests/end-to-end/api/14-assets.js
  20. 3
      tests/end-to-end/ui/00-login.js
  21. 2
      tests/end-to-end/ui/01-register.js
  22. 2
      tests/end-to-end/ui/02-forgot-password.js
  23. 3
      tests/end-to-end/ui/03-user-creation.js
  24. 3
      tests/end-to-end/ui/04-main-elements-render.js
  25. 3
      tests/end-to-end/ui/05-channel-creation.js
  26. 3
      tests/end-to-end/ui/06-messaging.js
  27. 3
      tests/end-to-end/ui/07-emoji.js
  28. 3
      tests/end-to-end/ui/08-resolutions.js
  29. 3
      tests/end-to-end/ui/09-channel.js
  30. 3
      tests/end-to-end/ui/10-user-preferences.js
  31. 3
      tests/end-to-end/ui/11-admin.js
  32. 17
      tests/end-to-end/ui/12-settings.js
  33. 3
      tests/end-to-end/ui/13-permissions.js
  34. 3
      tests/end-to-end/ui/14-message-popup.js
  35. 2
      tests/pageobjects/setup-wizard.page.js

@ -6,7 +6,6 @@
"AccountBox" : false,
"Apps" : false,
"Assets" : false,
"browser" : false,
"ChatMessage" : false,
"ChatMessages" : false,
"ChatRoom" : false,
@ -24,7 +23,6 @@
"Settings" : false,
"SideNav" : false,
"t" : false,
"TimeSync" : false,
"VideoRecorder" : false,
"VRecDialog" : false
}

@ -0,0 +1,12 @@
{
"env": {
"mocha": true
},
"globals": {
"browser": false,
"expect": false,
"FlowRouter": false,
"Meteor": false,
"RocketChat": false
}
}

@ -1,5 +1,3 @@
/* globals Meteor */
import loginPage from '../pageobjects/login.page';
import mainContent from '../pageobjects/main-content.page';
import sideNav from '../pageobjects/side-nav.page';

@ -1,10 +1,5 @@
/* eslint-env mocha */
/* globals expect */
/* eslint no-unused-vars: 0 */
import { getCredentials, api, login, request, credentials } from '../../data/api-data.js';
import { adminEmail, adminUsername, adminPassword, password } from '../../data/user.js';
import supertest from 'supertest';
describe('miscellaneous', function() {
this.retries(0);

@ -1,12 +1,7 @@
/* eslint-env mocha */
/* globals expect */
/* eslint no-unused-vars: 0 */
import crypto from 'crypto';
import {
getCredentials,
api,
login,
request,
credentials,
apiEmail,
@ -989,7 +984,7 @@ describe('[Users]', function() {
});
});
describe('Testing if the returned token is valid:', (done) => {
describe('Testing if the returned token is valid:', () => {
it('should return 200', (done) => request.post(api('users.createToken'))
.set(credentials)
.send({ username: user.username })

@ -1,22 +1,12 @@
/* eslint-env mocha */
/* globals expect */
/* eslint no-unused-vars: 0 */
import {
getCredentials,
api,
login,
request,
credentials,
apiEmail,
apiUsername,
targetUser,
log,
apiPublicChannelName,
channel,
} from '../../data/api-data.js';
import { adminEmail, password, adminUsername } from '../../data/user.js';
import supertest from 'supertest';
import { adminUsername } from '../../data/user.js';
function getRoomInfo(roomId) {
return new Promise((resolve/* , reject*/) => {

@ -1,10 +1,4 @@
/* eslint-env mocha */
/* globals expect */
/* eslint no-unused-vars: 0 */
import { getCredentials, api, login, request, credentials, group, log, apiPrivateChannelName } from '../../data/api-data.js';
import { adminEmail, password } from '../../data/user.js';
import supertest from 'supertest';
import { getCredentials, api, request, credentials, group, apiPrivateChannelName } from '../../data/api-data.js';
import { adminUsername } from '../../data/user';
function getRoomInfo(roomId) {

@ -1,20 +1,13 @@
/* eslint-env mocha */
/* globals expect */
/* eslint no-unused-vars: 0 */
import {
getCredentials,
api,
login,
request,
credentials,
directMessage,
log,
apiUsername,
apiEmail,
} from '../../data/api-data.js';
import { adminEmail, password } from '../../data/user.js';
import supertest from 'supertest';
import { password } from '../../data/user.js';
import { adminUsername } from '../../data/user';
describe('[Direct Messages]', function() {

@ -1,7 +1,3 @@
/* eslint-env mocha */
/* globals expect */
/* eslint no-unused-vars: 0 */
import {
getCredentials,
api,

@ -1,10 +1,4 @@
/* eslint-env mocha */
/* globals expect */
/* eslint no-unused-vars: 0 */
import { getCredentials, api, login, request, credentials, integration, log } from '../../data/api-data.js';
import { adminEmail, password } from '../../data/user.js';
import supertest from 'supertest';
import { api, request, credentials, integration } from '../../data/api-data.js';
describe('Outgoing Integrations', function() {
this.retries(0);

@ -1,5 +1,3 @@
/* eslint-env mocha */
import { getCredentials, api, request, credentials } from '../../data/api-data.js';
describe('Incoming Integrations', function() {

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* globals expect */
import { getCredentials, api, request, credentials } from '../../data/api-data.js';
describe('[Settings]', function() {

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* globals expect */
import { getCredentials, api, request, credentials } from '../../data/api-data.js';
import { password } from '../../data/user';
import { closeRoom, createRoom } from '../../data/rooms.helper';

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* globals expect */
import { getCredentials, api, request, credentials } from '../../data/api-data.js';
describe('[Subscriptions]', function() {

@ -1,5 +1,3 @@
/* eslint-env mocha */
const supertest = require('supertest');
const request = supertest('http://localhost:3000');

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* globals expect */
import { getCredentials, api, request, credentials } from '../../data/api-data.js';
describe('[Permissions]', function() {

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* globals expect */
import { getCredentials, api, request, credentials } from '../../data/api-data.js';
describe('[EmojiCustom]', function() {

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* globals expect */
import {
getCredentials,
api,

@ -1,7 +1,3 @@
/* eslint-env mocha */
/* globals expect */
/* eslint no-unused-vars: 0 */
import {
getCredentials,
api,

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* globals Meteor, FlowRouter */
import loginPage from '../../pageobjects/login.page';
import setupWizard from '../../pageobjects/setup-wizard.page';

@ -1,5 +1,3 @@
/* eslint-env mocha */
import loginPage from '../../pageobjects/login.page';
describe('[Register]', () => {

@ -1,5 +1,3 @@
/* eslint-env mocha */
import loginPage from '../../pageobjects/login.page';
describe('[Forgot Password]', () => {

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import loginPage from '../../pageobjects/login.page';
import mainContent from '../../pageobjects/main-content.page';

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import flexTab from '../../pageobjects/flex-tab.page';
import mainContent from '../../pageobjects/main-content.page';
import sideNav from '../../pageobjects/side-nav.page';

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import sideNav from '../../pageobjects/side-nav.page';
import { publicChannelName, privateChannelName } from '../../data/channel.js';
import { targetUser } from '../../data/interactions.js';

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import mainContent from '../../pageobjects/main-content.page';
import sideNav from '../../pageobjects/side-nav.page';
import Global from '../../pageobjects/global';

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import mainContent from '../../pageobjects/main-content.page';
import sideNav from '../../pageobjects/side-nav.page';

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import Global from '../../pageobjects/global';
import mainContent from '../../pageobjects/main-content.page';
import sideNav from '../../pageobjects/side-nav.page';

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import flexTab from '../../pageobjects/flex-tab.page';
import mainContent from '../../pageobjects/main-content.page';
import sideNav from '../../pageobjects/side-nav.page';

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import flexTab from '../../pageobjects/flex-tab.page';
import mainContent from '../../pageobjects/main-content.page';
import sideNav from '../../pageobjects/side-nav.page';

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import sideNav from '../../pageobjects/side-nav.page';
import flexTab from '../../pageobjects/flex-tab.page';
import admin from '../../pageobjects/administration.page';

@ -1,7 +1,3 @@
/* eslint-env mocha */
/* globals expect */
/* eslint no-unused-vars: 0 */
import loginPage from '../../pageobjects/login.page';
import supertest from 'supertest';
const request = supertest('http://localhost:3000');
@ -14,7 +10,6 @@ import admin from '../../pageobjects/administration.page';
// test data imports
import { checkIfUserIsValid, checkIfUserIsAdmin } from '../../data/checks';
import { targetUser, imgURL } from '../../data/interactions.js';
import { adminUsername, adminEmail, adminPassword, username, email, password, reason } from '../../data/user.js';
@ -22,14 +17,6 @@ function api(path) {
return prefix + path;
}
function log(res) {
console.log(res.req.path);
console.log({
body: res.body,
headers: res.headers,
});
}
const credentials = {
['X-Auth-Token']: undefined,
['X-User-Id']: undefined,
@ -40,10 +27,6 @@ const login = {
password: adminPassword,
};
const settingValue = {
value : undefined,
};
describe('[Api Settings Change]', () => {
before((done) => {
checkIfUserIsValid(username, email, password);

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import sideNav from '../../pageobjects/side-nav.page';
import flexTab from '../../pageobjects/flex-tab.page';
import admin from '../../pageobjects/administration.page';

@ -1,6 +1,3 @@
/* eslint-env mocha */
/* globals Meteor */
import { adminEmail, adminPassword } from '../../data/user.js';
import {

@ -1,5 +1,3 @@
/* globals Meteor */
import Page from './Page';
import { adminEmail, adminPassword } from '../data/user';

Loading…
Cancel
Save