Skip to content

Commit c305873

Browse files
authored
tests: add eslintrc jest env and remove all the env comments (#13954)
1 parent e107194 commit c305873

File tree

329 files changed

+96
-664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

329 files changed

+96
-664
lines changed

build/test/plugins/.eslintrc.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license Copyright 2022 The Lighthouse Authors. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5+
*/
6+
7+
module.exports = {
8+
env: {
9+
jest: true,
10+
},
11+
};

build/test/plugins/inline-fs-test.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
55
*/
66

7-
8-
/* eslint-env jest */
9-
107
import fs from 'fs';
118
import path from 'path';
129

clients/test/.eslintrc.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license Copyright 2022 The Lighthouse Authors. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5+
*/
6+
7+
module.exports = {
8+
env: {
9+
jest: true,
10+
},
11+
};

clients/test/extension/popup-test-pptr.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*/
66
'use strict';
77

8-
/* eslint-env jest */
9-
108
const path = require('path');
119
const puppeteer = require('puppeteer-core');
1210
const {getChromePath} = require('chrome-launcher');

clients/test/extension/settings-controller-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*/
66
'use strict';
77

8-
/* eslint-env jest */
9-
108
const SettingsController = require('../../extension/scripts/settings-controller.js');
119
const defaultConfig = require('../../../lighthouse-core/config/default-config.js');
1210
const format = require('../../../shared/localization/format.js');

clients/test/lightrider/lightrider-entry-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import {runLighthouseInLR} from '../../lightrider/lightrider-entry.js';
1111
import Runner from '../../../lighthouse-core/runner.js';
1212
import LHError from '../../../lighthouse-core/lib/lh-error.js';
1313

14-
/* eslint-env jest */
15-
1614
describe('lightrider-entry', () => {
1715
describe('#runLighthouseInLR', () => {
1816
it('returns a runtimeError LHR when lighthouse throws a runtimeError', async () => {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license Copyright 2022 The Lighthouse Authors. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5+
*/
6+
7+
module.exports = {
8+
env: {
9+
jest: true,
10+
},
11+
};

docs/recipes/integration-test/example-lh-auth.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
55
*/
66
'use strict';
7-
8-
/* eslint-env jest */
97
/* eslint-disable new-cap */
108

119
/**

lighthouse-cli/test/.eslintrc.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license Copyright 2022 The Lighthouse Authors. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5+
*/
6+
7+
module.exports = {
8+
env: {
9+
jest: true,
10+
},
11+
};

lighthouse-cli/test/cli/bin-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
55
*/
66

7-
/* eslint-env jest */
8-
97
import fs from 'fs';
108

119
import {jest} from '@jest/globals';

lighthouse-cli/test/cli/cli-flags-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
55
*/
66

7-
/* eslint-env jest */
8-
97
import {strict as assert} from 'assert';
108
import fs from 'fs';
119

lighthouse-cli/test/cli/index-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
55
*/
66

7-
/* eslint-env jest */
8-
97
import {strict as assert} from 'assert';
108
import {spawnSync} from 'child_process';
119

lighthouse-cli/test/cli/printer-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
55
*/
66

7-
/* eslint-env jest */
8-
97
import {strict as assert} from 'assert';
108
import fs from 'fs';
119

lighthouse-cli/test/cli/run-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
55
*/
66

7-
/* eslint-env jest */
8-
97
import {strict as assert} from 'assert';
108
import path from 'path';
119
import fs from 'fs';

lighthouse-cli/test/fixtures/static-server-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import fetch from 'node-fetch';
1010

1111
import {server} from './static-server.js';
1212

13-
/* eslint-env jest */
1413

1514
describe('Server', () => {
1615
beforeAll(async () => {

lighthouse-cli/test/smokehouse/version-check-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
import {chromiumVersionCheck, compareVersions} from './version-check.js';
88

9-
/* eslint-env jest */
10-
119
describe('version check', () => {
1210
it('compareVersions', async () => {
1311
expect(compareVersions([100, 0, 0, 0], [100, 0, 0, 0])).toBe(0);

lighthouse-core/test/.eslintrc.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66

77
module.exports = {
8+
env: {
9+
jest: true,
10+
},
811
rules: {
912
// TODO(esmodules): move to root eslint when all code is ESM
1013
// or when this is resolved: https://github.com/import-js/eslint-plugin-import/issues/2214

lighthouse-core/test/audits/accessibility/aria-allowed-attr-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/aria-allowed-attr.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: aria-allowed-attr audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/aria-required-attr-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/aria-required-attr.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: aria-required-attr audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/aria-required-children-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/aria-required-children.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: aria-required-children audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/aria-required-parent-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/aria-required-parent.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: aria-required-parent audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/aria-roles-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/aria-roles.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: aria-roles audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/aria-valid-attr-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/aria-valid-attr.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: aria-valid-attr audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/aria-valid-attr-value-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/aria-valid-attr-value.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: aria-valid-attr-value audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/axe-audit-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import AxeAudit from '../../../audits/accessibility/axe-audit.js';
1313
import Accesskeys from '../../../audits/accessibility/accesskeys.js';
1414
import format from '../../../../shared/localization/format.js';
1515

16-
/* eslint-env jest */
17-
1816
describe('Accessibility: axe-audit', () => {
1917
describe('audit()', () => {
2018
it('generates audit output using subclass meta', () => {

lighthouse-core/test/audits/accessibility/button-name-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/button-name.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: button-name audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/bypass-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/bypass.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: bypass audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/color-contrast-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/color-contrast.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: color-contrast audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/definition-list-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/definition-list.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: definition-list audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/dlitem-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/dlitem.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: dlitem audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/document-title-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/document-title.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: document-title audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/frame-title-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/frame-title.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: frame-title audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/html-has-lang-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/html-has-lang.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: html-has-lang audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/html-lang-valid-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/html-lang-valid.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: html-lang-valid audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/image-alt-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/image-alt.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: image-alt audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/input-image-alt-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/input-image-alt.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: input-image-alt audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/label-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/label.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: label audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/link-name-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/link-name.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: link-name audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/list-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/list.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: list audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/listitem-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/listitem.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: listitem audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/meta-refresh-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/meta-refresh.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: meta-refresh audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/meta-viewport-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/meta-viewport.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: meta-viewport audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

lighthouse-core/test/audits/accessibility/object-alt-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {strict as assert} from 'assert';
99

1010
import Audit from '../../../audits/accessibility/object-alt.js';
1111

12-
/* eslint-env jest */
13-
1412
describe('Accessibility: object-alt audit', () => {
1513
it('generates an audit output', () => {
1614
const artifacts = {

0 commit comments

Comments
 (0)