Skip to content

Commit

Permalink
test: apply changes requested in code review
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Nov 27, 2021
1 parent 3fe987e commit 86830cc
Show file tree
Hide file tree
Showing 62 changed files with 32 additions and 61 deletions.
6 changes: 6 additions & 0 deletions .eslintrc
Expand Up @@ -26,6 +26,12 @@
{
"files": ["__tests__/src/rules/*.js"],
"extends": ["plugin:eslint-plugin/tests-recommended"]
},
{
"files": ["__tests__/**/*.js"],
"env": {
"jest": true
}
}
]
}
2 changes: 0 additions & 2 deletions .gitignore
Expand Up @@ -3,8 +3,6 @@ coverage/
lib
node_modules
npm-debug.log
.vscode
.idea

npm-shrinkwrap.json
package-lock.json
Expand Down
2 changes: 1 addition & 1 deletion __tests__/index-test.js
@@ -1,8 +1,8 @@
/* eslint-env jest */
/* eslint global-require: 0 */

import fs from 'fs';
import path from 'path';
import expect from 'expect';
import plugin from '../src';

const rules = fs.readdirSync(path.resolve(__dirname, '../src/rules/'))
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/accessible-emoji-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce <marquee> elements are not used.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/alt-text-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce all elements that require alternative text have it.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/anchor-has-content-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce anchor elements to contain accessible content.
* @author Lisa Ring & Niklas Holmberg
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/anchor-is-valid-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Performs validity check on anchor hrefs. Warns when anchors are used as buttons.
* @author Almero Steyn
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/aria-props-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce all aria-* properties are valid.
* @author Ethan Cohen
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/rules/aria-proptypes-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce ARIA state and property values are valid.
* @author Ethan Cohen
Expand All @@ -10,6 +9,7 @@

import { aria } from 'aria-query';
import { RuleTester } from 'eslint';
import expect from 'expect';
import parserOptionsMapper from '../../__util__/parserOptionsMapper';
import rule from '../../../src/rules/aria-proptypes';

Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/aria-role-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce aria role attribute is valid.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/aria-unsupported-elements-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce that elements that do not support ARIA roles,
* states and properties do not have those attributes.
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/autocomplete-valid-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Ensure autocomplete attribute is correct.
* @author Wilco Fiers
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/click-events-have-key-events-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce a clickable non-interactive element has at least 1 keyboard event listener.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/control-has-associated-label-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Control elements must be associated with a text label
* @author jessebeach
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/heading-has-content-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce heading (h1, h2, etc) elements contain accessible content.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/html-has-lang-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce html element has lang prop.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/iframe-has-title-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce iframe elements have a title attribute.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/img-redundant-alt-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce img alt attribute does not have the word image, picture, or photo.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/interactive-supports-focus-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce that elements with onClick handlers must be focusable.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/label-has-associated-control-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce label tags have an associated control.
* @author Jesse Beach
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/label-has-for-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce label tags have htmlFor attribute.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/lang-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce lang attribute has a valid value.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/media-has-caption-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview <audio> and <video> elements must have a <track> for captions.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/mouse-events-have-key-events-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce onmouseover/onmouseout are accompanied
* by onfocus/onblur.
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/no-access-key-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce no accesskey attribute on element.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/no-autofocus-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce autoFocus prop is not used.
* @author Ethan Cohen <@evcohen>
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/no-distracting-elements-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce distracting elements are not used.
* @author Ethan Cohen
Expand Down
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Disallow inherently interactive elements to be assigned
* non-interactive roles.
Expand Down
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce non-interactive elements have no interactive handlers.
* @author Ethan Cohen
Expand Down
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Disallow inherently non-interactive elements to be assigned
* interactive roles.
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/no-noninteractive-tabindex-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Disallow tabindex on static and noninteractive elements
* @author jessebeach
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/no-onchange-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce usage of onBlur over onChange on select menus for accessibility.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/no-redundant-roles-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce explicit role property is not the
* same as implicit default role property on element.
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/no-static-element-interactions-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce static elements have no interactive handlers.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/role-has-required-aria-props-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce that elements with ARIA roles must
* have all required attributes for that role.
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/role-supports-aria-props-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce that an element does not have an unsupported ARIA attribute.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/scope-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce scope prop is only used on <th> elements.
* @author Ethan Cohen
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/tabindex-no-positive-test.js
@@ -1,4 +1,3 @@
/* eslint-env jest */
/**
* @fileoverview Enforce tabIndex value is not greater than zero.
* @author Ethan Cohen
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/attributesComparator-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import attributesComparator from '../../../src/util/attributesComparator';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';
import JSXElementMock from '../../../__mocks__/JSXElementMock';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/getComputedRole-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import getComputedRole from '../../../src/util/getComputedRole';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/getExplicitRole-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import getExplicitRole from '../../../src/util/getExplicitRole';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/getImplicitRole-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import getImplicitRole from '../../../src/util/getImplicitRole';

describe('getImplicitRole', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/getSuggestion-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import getSuggestion from '../../../src/util/getSuggestion';

describe('spell check suggestion API', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/getTabIndex-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import getTabIndex from '../../../src/util/getTabIndex';
import IdentifierMock from '../../../__mocks__/IdentifierMock';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/hasAccessibleChild-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import hasAccessibleChild from '../../../src/util/hasAccessibleChild';
import JSXElementMock from '../../../__mocks__/JSXElementMock';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/implicitRoles/input-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import JSXAttributeMock from '../../../../__mocks__/JSXAttributeMock';
import getImplicitRoleForInput from '../../../../src/util/implicitRoles/input';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/implicitRoles/menu-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import JSXAttributeMock from '../../../../__mocks__/JSXAttributeMock';
import getImplicitRoleForMenu from '../../../../src/util/implicitRoles/menu';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/implicitRoles/menuitem-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import JSXAttributeMock from '../../../../__mocks__/JSXAttributeMock';
import getImplicitRoleForMenuitem from '../../../../src/util/implicitRoles/menuitem';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/isAbstractRole-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import { elementType } from 'jsx-ast-utils';
import isAbstractRole from '../../../src/util/isAbstractRole';
import {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/isDOMElement-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import { dom } from 'aria-query';
import { elementType } from 'jsx-ast-utils';
import isDOMElement from '../../../src/util/isDOMElement';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/isDisabledElement-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import isDisabledElement from '../../../src/util/isDisabledElement';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/isInteractiveElement-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import { elementType } from 'jsx-ast-utils';
import isInteractiveElement from '../../../src/util/isInteractiveElement';
import JSXElementMock from '../../../__mocks__/JSXElementMock';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/isInteractiveRole-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import { elementType } from 'jsx-ast-utils';
import isInteractiveRole from '../../../src/util/isInteractiveRole';
import {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/isNonInteractiveElement-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import { elementType } from 'jsx-ast-utils';
import isNonInteractiveElement from '../../../src/util/isNonInteractiveElement';
import {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/isNonInteractiveRole-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import { elementType } from 'jsx-ast-utils';
import isNonInteractiveRole from '../../../src/util/isNonInteractiveRole';
import {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/isNonLiteralProperty-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import isNonLiteralProperty from '../../../src/util/isNonLiteralProperty';
import IdentifierMock from '../../../__mocks__/IdentifierMock';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/isSemanticRoleElement-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import isSemanticRoleElement from '../../../src/util/isSemanticRoleElement';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/mayContainChildComponent-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import mayContainChildComponent from '../../../src/util/mayContainChildComponent';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';
import JSXElementMock from '../../../__mocks__/JSXElementMock';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/mayHaveAccessibleLabel-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import mayHaveAccessibleLabel from '../../../src/util/mayHaveAccessibleLabel';
import JSXAttributeMock from '../../../__mocks__/JSXAttributeMock';
import JSXElementMock from '../../../__mocks__/JSXElementMock';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/parserOptionsMapper-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import parserOptionsMapper from '../../__util__/parserOptionsMapper';

describe('parserOptionsMapper', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/util/schemas-test.js
@@ -1,4 +1,4 @@
/* eslint-env jest */
import expect from 'expect';
import { generateObjSchema, arraySchema, enumArraySchema } from '../../../src/util/schemas';

describe('schemas', () => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -46,6 +46,7 @@
"eslint-plugin-flowtype": "^5.8.0 || ^8.0.2",
"eslint-plugin-import": "^2.25.3",
"estraverse": "^5.3.0",
"expect": "^24.9.0",
"flow-bin": "^0.147.0",
"in-publish": "^2.0.1",
"jest": "^24.9.0",
Expand Down

0 comments on commit 86830cc

Please sign in to comment.