Skip to content

Commit

Permalink
ELEMENTS-1153: simplify test linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuno Cunha committed Apr 6, 2020
1 parent 0a8d728 commit 49c3d61
Show file tree
Hide file tree
Showing 37 changed files with 16 additions and 94 deletions.
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,19 @@ module.exports = {
Polymer: 'readonly',
},
},
{
files: ['**/*.test.js'],
env: {
mocha: true,
},
rules: {
'no-unused-expressions': 'off',
},
globals: {
assert: 'readable',
expect: 'readable',
sinon: 'readable',
},
},
],
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
analysis.json
node_modules
coverage
4 changes: 0 additions & 4 deletions core/.gitignore

This file was deleted.

13 changes: 0 additions & 13 deletions core/test/.eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion core/test/nuxeo-document.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { waitChanged, fixture, html } from '@nuxeo/testing-helpers';
import '../nuxeo-document.js';

/* eslint-disable no-unused-expressions */
suite('nuxeo-document', () => {
const responseHeaders = {
json: { 'Content-Type': 'application/json' },
Expand Down
1 change: 0 additions & 1 deletion core/test/nuxeo-operation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { fixture, html, waitChanged } from '@nuxeo/testing-helpers';
import '../nuxeo-operation.js';
import '../nuxeo-page-provider.js';

/* eslint-disable no-unused-expressions */
suite('nuxeo-operation', () => {
const responseHeaders = {
json: { 'Content-Type': 'application/json' },
Expand Down
1 change: 0 additions & 1 deletion core/test/nuxeo-page-provider.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { fixture, html } from '@nuxeo/testing-helpers';
import '../nuxeo-page-provider.js';

/* eslint-disable no-unused-expressions */
suite('nuxeo-page-provider', () => {
const responseHeaders = {
json: { 'Content-Type': 'application/json' },
Expand Down
1 change: 0 additions & 1 deletion core/test/nuxeo-resource.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { fixture, html } from '@nuxeo/testing-helpers';
import '../nuxeo-resource.js';

/* eslint-disable no-unused-expressions */
suite('nuxeo-resource', () => {
const responseHeaders = {
json: { 'Content-Type': 'application/json' },
Expand Down
1 change: 0 additions & 1 deletion core/test/nuxeo-task-page-provider.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import '../nuxeo-task-page-provider.js';
import { fakeServer, fixture, html, waitForEvent } from '@nuxeo/testing-helpers';

/* eslint-disable no-unused-expressions */
suite('nuxeo-task-page-provider', () => {
suite('REST Calls', () => {
let server;
Expand Down
1 change: 0 additions & 1 deletion core/test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
import { createNestedObject } from '../utils.js';

/* eslint-disable no-unused-expressions */
suite('utils', () => {
suite('"createNestedObject" function', () => {
suite('Parameters Validation', () => {
Expand Down
3 changes: 0 additions & 3 deletions dataviz/.gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions dataviz/test/.eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions polymer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"lint": {
"rules": ["polymer-3"],
"filesToIgnore": ["**/node_modules/**/*.js"],
"ignoreWarnings": [
"databinding-calls-must-be-functions",
"could-not-resolve-reference"
Expand Down
3 changes: 0 additions & 3 deletions testing-helpers/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions testing-helpers/.npmignore

This file was deleted.

3 changes: 0 additions & 3 deletions ui/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions ui/test/.eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion ui/test/nuxeo-actions-menu.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import '../widgets/nuxeo-actions-menu.js';

window.html = html; // make it available for building custom elements inline

/* eslint-disable no-unused-expressions */
suite('nuxeo-actions-menu', () => {
function makeMenuContent(n = 5) {
return html`
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-create-group.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { fixture, flush, html, login, tap, waitChanged } from '@nuxeo/testing-helpers';
import { dom } from '@polymer/polymer/lib/legacy/polymer.dom.js';
import '../nuxeo-user-group-management/nuxeo-create-group.js';
/* eslint-disable no-unused-expressions */

suite('nuxeo-create-group', () => {
let server;
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-date-picker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { fixture, html } from '@nuxeo/testing-helpers';
import moment from '@nuxeo/moment';
import '../widgets/nuxeo-date-picker.js';
/* eslint-disable no-unused-expressions */

function getInput(element) {
return element.root.querySelector('#date');
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-delete-document-button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { fixture, flush, html, isElementVisible, tap, waitForEvent } from '@nuxeo/testing-helpers';
import { dom } from '@polymer/polymer/lib/legacy/polymer.dom';
import '../actions/nuxeo-delete-document-button.js';
/* eslint-disable no-unused-expressions */

const getActionDiv = (button) => dom(button.root).querySelector('.action');

Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-document-comment-thread.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
waitForEvent,
} from '@nuxeo/testing-helpers';

/* eslint-disable no-unused-expressions */
suite('nuxeo-document-comment-thread', () => {
let element;
let server;
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-document-comment.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ function getCommentContent(element) {
return element.shadowRoot.querySelector('#content');
}

/* eslint-disable no-unused-expressions */
suite('nuxeo-document-comment', () => {
const longText =
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. ' +
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-document-layout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Nuxeo.LayoutBehavior = LayoutBehavior;
const { url } = import.meta;
const base = url.substring(0, url.lastIndexOf('/'));

/* eslint-disable no-unused-expressions */
suite('nuxeo-document-layout', () => {
let documentLayout;
const baseUrl = `${base}/layouts/document/`;
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-error.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.
*/
import { fixture, flush, html, isElementVisible } from '@nuxeo/testing-helpers';
import '../nuxeo-error.js';
/* eslint-disable no-unused-expressions */

suite('<nuxeo-error>', () => {
const expectNuxeoErrorContent = (nuxeoError, code, description, url, message) => {
Expand Down
2 changes: 0 additions & 2 deletions ui/test/nuxeo-favorites-toggle-button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ limitations under the License.
import { fixture, html, login, tap, waitChanged } from '@nuxeo/testing-helpers';
import '../actions/nuxeo-favorites-toggle-button.js';

/* eslint-disable no-unused-expressions */

suite('nuxeo-favorites-toggle-button', () => {
let server;
setup(async () => {
Expand Down
2 changes: 0 additions & 2 deletions ui/test/nuxeo-filter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import { dom } from '@polymer/polymer/lib/legacy/polymer.dom.js';
import '../nuxeo-filter.js';
import '../nuxeo-slots.js';

/* eslint-disable no-unused-expressions */

function stamped(filter, clazz) {
return dom(filter).querySelectorAll(`${clazz || '*'}:not(nuxeo-filter):not(template)`);
}
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-html-editor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { fixture, isElementVisible, html } from '@nuxeo/testing-helpers';
import '../widgets/nuxeo-html-editor.js';

/* eslint-disable no-unused-expressions */
suite('nuxeo-html-editor', () => {
test('should display the placeholder when empty', async () => {
const editor = await fixture(
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-image-viewer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import '../viewers/nuxeo-image-viewer.js';
const { url } = import.meta;
const base = url.substring(0, url.lastIndexOf('/'));

/* eslint-disable no-unused-expressions */
suite('nuxeo-image-viewer', () => {
const viewerLoad = (viewer) => {
if (viewer._el && viewer._el.ready) {
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-layout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { fixture, flush, html, isElementVisible, waitChanged, waitForAttrMutatio
import { Polymer } from '@polymer/polymer/polymer-legacy.js';
import '../nuxeo-layout.js';
import '../widgets/nuxeo-input.js';
/* eslint-disable no-unused-expressions */

// determine base module path (relies on @open-wc/webpack-import-meta-loader)
const { url } = import.meta;
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-lock-toggle-button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { fixture, flush, html, login, tap, waitForEvent } from '@nuxeo/testing-helpers';
import { dom } from '@polymer/polymer/lib/legacy/polymer.dom';
import '../actions/nuxeo-lock-toggle-button.js';
/* eslint-disable no-unused-expressions */

suite('nuxeo-lock-toggle-button', () => {
let button;
Expand Down
2 changes: 0 additions & 2 deletions ui/test/nuxeo-notifications-toggle-button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ limitations under the License.
import { fixture, html, login, tap, waitChanged } from '@nuxeo/testing-helpers';
import '../actions/nuxeo-notifications-toggle-button.js';

/* eslint-disable no-unused-expressions */

suite('nuxeo-notifications-toggle-button', () => {
let server;
setup(async () => {
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-selectivity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
import { dom } from '@polymer/polymer/lib/legacy/polymer.dom.js';
import '../widgets/nuxeo-selectivity.js';

/* eslint-disable no-unused-expressions */
suite('nuxeo-selectivity', () => {
let selectivityWidget;
const data = ['Berlin', 'Lisbon', 'London', 'Rennes', 'Rome'];
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-slots.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { fixture, flush, html, waitForChildListMutation } from '@nuxeo/testing-helpers';
import * as polymer from '@polymer/polymer';
import '../nuxeo-slots.js';
/* eslint-disable no-unused-expressions */

// return all children excluding <nuxeo-slot>
function _content(slot) {
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-uploader-behavior.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { fixture, html, login } from '@nuxeo/testing-helpers';
import '../widgets/nuxeo-file.js';
import { UploaderBehavior } from '../widgets/nuxeo-uploader-behavior.js';
/* eslint-disable no-unused-expressions */

suite('Nuxeo.UploaderBehavior', () => {
let DefaultUploadProvider;
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-video-conversions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { fixture, flush, html, isElementVisible } from '@nuxeo/testing-helpers';
import '../nuxeo-video/nuxeo-video-conversions.js';
import videoProperties from './resources/videoProperties';
/* eslint-disable no-unused-expressions */

suite('nuxeo-video-conversions', () => {
suite('Displaying element when no parameters provided', () => {
Expand Down
1 change: 0 additions & 1 deletion ui/test/nuxeo-video-info.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
import { fixture, flush, html, isElementVisible } from '@nuxeo/testing-helpers';
import '../nuxeo-video/nuxeo-video-info.js';
import videoProperties from './resources/videoProperties';
/* eslint-disable no-unused-expressions */

suite('nuxeo-video-info', () => {
let element;
Expand Down

0 comments on commit 49c3d61

Please sign in to comment.