diff --git a/.eslintrc.json b/.eslintrc.json index 35a7bb1700..6f566f3beb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,7 +3,8 @@ "es6": true, "browser": true, "mocha": true, - "node": true + "node": true, + "jest": true }, "parser": "babel-eslint", "root": true, diff --git a/api-server/src/common/models/User-Identity.test.js b/api-server/src/common/models/User-Identity.test.js index db798d8a6e..7c5b66a0c4 100644 --- a/api-server/src/common/models/User-Identity.test.js +++ b/api-server/src/common/models/User-Identity.test.js @@ -1,4 +1,3 @@ -/* global expect */ import { ensureLowerCaseEmail } from './User-Identity'; test('returns lowercase email when one exists', () => { diff --git a/api-server/src/server/boot_tests/certificate.test.js b/api-server/src/server/boot_tests/certificate.test.js index 9d909e821b..bd403f1958 100644 --- a/api-server/src/server/boot_tests/certificate.test.js +++ b/api-server/src/server/boot_tests/certificate.test.js @@ -1,5 +1,3 @@ -/* global it expect */ - import { getFallbackFrontEndDate } from '../boot/certificate'; import { fullStackChallenges } from './fixtures'; diff --git a/api-server/src/server/boot_tests/challenge.test.js b/api-server/src/server/boot_tests/challenge.test.js index 291bc93a7e..6431a31cf4 100644 --- a/api-server/src/server/boot_tests/challenge.test.js +++ b/api-server/src/server/boot_tests/challenge.test.js @@ -1,4 +1,3 @@ -/* global describe xdescribe it expect jest */ import { first, find } from 'lodash'; import { diff --git a/api-server/src/server/boot_tests/fixtures.js b/api-server/src/server/boot_tests/fixtures.js index 7e82c13c33..6ac9dcbeac 100644 --- a/api-server/src/server/boot_tests/fixtures.js +++ b/api-server/src/server/boot_tests/fixtures.js @@ -1,4 +1,3 @@ -/* global jest*/ import { isEqual } from 'lodash'; import { isEmail } from 'validator'; diff --git a/api-server/src/server/middlewares/request-authorization.test.js b/api-server/src/server/middlewares/request-authorization.test.js index a4d56d2853..c83867dd3a 100644 --- a/api-server/src/server/middlewares/request-authorization.test.js +++ b/api-server/src/server/middlewares/request-authorization.test.js @@ -1,4 +1,3 @@ -/* global describe it expect jest */ import { mockReq as mockRequest, mockRes } from '../boot_tests/challenge.test'; import jwt from 'jsonwebtoken'; diff --git a/api-server/src/server/utils/date-utils.test.js b/api-server/src/server/utils/date-utils.test.js index dc3c3f703f..62b83d00b1 100644 --- a/api-server/src/server/utils/date-utils.test.js +++ b/api-server/src/server/utils/date-utils.test.js @@ -1,4 +1,3 @@ -/* global describe expect it */ import moment from 'moment-timezone'; import { dayCount } from './date-utils'; diff --git a/api-server/src/server/utils/donation.test.js b/api-server/src/server/utils/donation.test.js index 30538eac4c..8dc43098ee 100644 --- a/api-server/src/server/utils/donation.test.js +++ b/api-server/src/server/utils/donation.test.js @@ -1,7 +1,4 @@ /* eslint-disable camelcase */ -/* global describe it expect */ -/* global jest*/ - import axios from 'axios'; import keys from '../../../../config/secrets'; import { diff --git a/api-server/src/server/utils/getSetAccessToken.test.js b/api-server/src/server/utils/getSetAccessToken.test.js index 25af949bd6..477948eb9a 100644 --- a/api-server/src/server/utils/getSetAccessToken.test.js +++ b/api-server/src/server/utils/getSetAccessToken.test.js @@ -1,4 +1,3 @@ -/* global describe it expect */ import { getAccessTokenFromRequest, errorTypes, diff --git a/api-server/src/server/utils/in-memory-cache.test.js b/api-server/src/server/utils/in-memory-cache.test.js index 4798589fd4..eeb2544117 100644 --- a/api-server/src/server/utils/in-memory-cache.test.js +++ b/api-server/src/server/utils/in-memory-cache.test.js @@ -1,4 +1,3 @@ -/* global describe beforeEach expect it jest */ import inMemoryCache from './in-memory-cache'; describe('InMemoryCache', () => { diff --git a/api-server/src/server/utils/redirection.test.js b/api-server/src/server/utils/redirection.test.js index 83c111ed57..8f3cfe8984 100644 --- a/api-server/src/server/utils/redirection.test.js +++ b/api-server/src/server/utils/redirection.test.js @@ -1,5 +1,3 @@ -/* global describe expect it jest */ - const jwt = require('jsonwebtoken'); const { getReturnTo, normalizeParams } = require('./redirection'); diff --git a/api-server/src/server/utils/user-stats.test.js b/api-server/src/server/utils/user-stats.test.js index dfe8c59396..bc400b772d 100644 --- a/api-server/src/server/utils/user-stats.test.js +++ b/api-server/src/server/utils/user-stats.test.js @@ -1,4 +1,3 @@ -/* global describe it expect jest */ import moment from 'moment-timezone'; import { diff --git a/client/i18n/locales.test.js b/client/i18n/locales.test.js index 18762d3de0..da36a0bfd0 100644 --- a/client/i18n/locales.test.js +++ b/client/i18n/locales.test.js @@ -1,4 +1,3 @@ -/* global expect */ import { availableLangs, langDisplayNames, diff --git a/client/src/__mocks__/react-i18nextMock.js b/client/src/__mocks__/react-i18nextMock.js index a9e8b10438..05fd1ffe90 100644 --- a/client/src/__mocks__/react-i18nextMock.js +++ b/client/src/__mocks__/react-i18nextMock.js @@ -1,6 +1,5 @@ /* eslint-disable react/prop-types */ /* eslint-disable react/display-name */ -/* global jest */ import React from 'react'; const reactI18next = jest.genMockFromModule('react-i18next'); diff --git a/client/src/__tests__/integration/handled-error.test.js b/client/src/__tests__/integration/handled-error.test.js index e8d633ef4d..80b0c5d6ee 100644 --- a/client/src/__tests__/integration/handled-error.test.js +++ b/client/src/__tests__/integration/handled-error.test.js @@ -1,4 +1,3 @@ -/* global describe it expect */ import { wrapHandledError, unwrapHandledError diff --git a/client/src/client-only-routes/ShowSettings.test.js b/client/src/client-only-routes/ShowSettings.test.js index 81dde8395f..11c2fbaf17 100644 --- a/client/src/client-only-routes/ShowSettings.test.js +++ b/client/src/client-only-routes/ShowSettings.test.js @@ -1,4 +1,3 @@ -/* global jest, expect */ import React from 'react'; import ShallowRenderer from 'react-test-renderer/shallow'; import envData from '../../../config/env.json'; diff --git a/client/src/components/Footer/Footer.test.js b/client/src/components/Footer/Footer.test.js index 4efe0d74cf..1b9dc6d41c 100644 --- a/client/src/components/Footer/Footer.test.js +++ b/client/src/components/Footer/Footer.test.js @@ -1,4 +1,3 @@ -/* global expect */ import React from 'react'; import renderer from 'react-test-renderer'; diff --git a/client/src/components/Header/Header.test.js b/client/src/components/Header/Header.test.js index 5ff50f0c2e..e93717a9f1 100644 --- a/client/src/components/Header/Header.test.js +++ b/client/src/components/Header/Header.test.js @@ -1,4 +1,3 @@ -/* global expect jest */ import React from 'react'; import ShallowRenderer from 'react-test-renderer/shallow'; diff --git a/client/src/components/Intro/Intro.test.js b/client/src/components/Intro/Intro.test.js index 9886c1ad45..c4601007d0 100644 --- a/client/src/components/Intro/Intro.test.js +++ b/client/src/components/Intro/Intro.test.js @@ -1,4 +1,3 @@ -/* global expect jest */ import React from 'react'; import renderer from 'react-test-renderer'; import { Provider } from 'react-redux'; diff --git a/client/src/components/Map/Map.test.js b/client/src/components/Map/Map.test.js index 2170f3b927..37e5c5bc33 100644 --- a/client/src/components/Map/Map.test.js +++ b/client/src/components/Map/Map.test.js @@ -1,5 +1,3 @@ -/* global expect jest */ - import React from 'react'; import { useStaticQuery } from 'gatsby'; import { render } from '@testing-library/react'; diff --git a/client/src/components/createExternalRedirects.test.js b/client/src/components/createExternalRedirects.test.js index e3a00abc1a..861edfbff3 100644 --- a/client/src/components/createExternalRedirects.test.js +++ b/client/src/components/createExternalRedirects.test.js @@ -1,5 +1,3 @@ -/* global expect */ - import createExternalRedirect from './createExternalRedirects'; describe('createExternalRedirects', () => { diff --git a/client/src/components/createLanguageRedirect.test.js b/client/src/components/createLanguageRedirect.test.js index 6033615b96..70ad0c5d8c 100644 --- a/client/src/components/createLanguageRedirect.test.js +++ b/client/src/components/createLanguageRedirect.test.js @@ -1,5 +1,3 @@ -/* global expect */ - import createLanguageRedirect from './createLanguageRedirect'; describe('createLanguageRedirect for clientLocale === english', () => { diff --git a/client/src/components/formHelpers/BlockSaveButton.test.js b/client/src/components/formHelpers/BlockSaveButton.test.js index 0dc63d57b3..8e17095cb7 100644 --- a/client/src/components/formHelpers/BlockSaveButton.test.js +++ b/client/src/components/formHelpers/BlockSaveButton.test.js @@ -1,5 +1,3 @@ -/* global expect */ - import React from 'react'; import { render } from '@testing-library/react'; diff --git a/client/src/components/formHelpers/BlockSaveWrapper.test.js b/client/src/components/formHelpers/BlockSaveWrapper.test.js index 0c8020797c..5091ac325a 100644 --- a/client/src/components/formHelpers/BlockSaveWrapper.test.js +++ b/client/src/components/formHelpers/BlockSaveWrapper.test.js @@ -1,5 +1,3 @@ -/* global expect */ - import React from 'react'; import { render } from '@testing-library/react'; diff --git a/client/src/components/formHelpers/Form.test.js b/client/src/components/formHelpers/Form.test.js index daf30c19f3..1dbb3a57f0 100644 --- a/client/src/components/formHelpers/Form.test.js +++ b/client/src/components/formHelpers/Form.test.js @@ -1,5 +1,3 @@ -/* global jest, expect */ - import React from 'react'; import { render, fireEvent } from '@testing-library/react'; diff --git a/client/src/components/helpers/Link.test.js b/client/src/components/helpers/Link.test.js index d1e051653a..13a2f2cc44 100644 --- a/client/src/components/helpers/Link.test.js +++ b/client/src/components/helpers/Link.test.js @@ -1,4 +1,3 @@ -/* global expect */ import React from 'react'; import renderer from 'react-test-renderer'; diff --git a/client/src/components/helpers/Loader.test.js b/client/src/components/helpers/Loader.test.js index 614f19d375..21bf667513 100644 --- a/client/src/components/helpers/Loader.test.js +++ b/client/src/components/helpers/Loader.test.js @@ -1,4 +1,3 @@ -/* global expect */ import React from 'react'; import { render, cleanup } from '@testing-library/react'; diff --git a/client/src/components/landing/Landing.test.js b/client/src/components/landing/Landing.test.js index dc1b0e8891..b4fe430a57 100644 --- a/client/src/components/landing/Landing.test.js +++ b/client/src/components/landing/Landing.test.js @@ -1,4 +1,3 @@ -/* global expect jest */ import React from 'react'; import ShallowRenderer from 'react-test-renderer/shallow'; diff --git a/client/src/components/profile/Profile.test.js b/client/src/components/profile/Profile.test.js index f4eec42c1e..feeed78bc5 100644 --- a/client/src/components/profile/Profile.test.js +++ b/client/src/components/profile/Profile.test.js @@ -1,5 +1,3 @@ -/* global expect jest */ - import React from 'react'; import { render } from '@testing-library/react'; diff --git a/client/src/components/profile/components/HeatMap.test.js b/client/src/components/profile/components/HeatMap.test.js index bd31f55a25..61fb0c4a84 100644 --- a/client/src/components/profile/components/HeatMap.test.js +++ b/client/src/components/profile/components/HeatMap.test.js @@ -1,5 +1,3 @@ -/* global expect jest */ - import React from 'react'; import { render } from '@testing-library/react'; diff --git a/client/src/components/profile/components/TimeLine.test.js b/client/src/components/profile/components/TimeLine.test.js index 14d585439a..55af94c564 100644 --- a/client/src/components/profile/components/TimeLine.test.js +++ b/client/src/components/profile/components/TimeLine.test.js @@ -1,5 +1,3 @@ -/* global expect */ - import React from 'react'; import { render } from '@testing-library/react'; import TimeLine from './TimeLine'; diff --git a/client/src/components/search/searchBar/SearchBar.test.js b/client/src/components/search/searchBar/SearchBar.test.js index 3752a78cfb..6db135acd1 100644 --- a/client/src/components/search/searchBar/SearchBar.test.js +++ b/client/src/components/search/searchBar/SearchBar.test.js @@ -1,4 +1,3 @@ -/* global jest, expect */ import React from 'react'; import ShallowRenderer from 'react-test-renderer/shallow'; diff --git a/client/src/components/settings/Certification.test.js b/client/src/components/settings/Certification.test.js index d14620d7e9..cdf10fd4e9 100644 --- a/client/src/components/settings/Certification.test.js +++ b/client/src/components/settings/Certification.test.js @@ -1,5 +1,3 @@ -/* global expect jest */ - import React from 'react'; import { render } from '@testing-library/react'; import { Provider } from 'react-redux'; diff --git a/client/src/components/settings/Honesty.test.js b/client/src/components/settings/Honesty.test.js index 173a582082..a7093c6acd 100644 --- a/client/src/components/settings/Honesty.test.js +++ b/client/src/components/settings/Honesty.test.js @@ -1,4 +1,3 @@ -/* global expect jest */ import React from 'react'; import ShallowRenderer from 'react-test-renderer/shallow'; import TestRenderer from 'react-test-renderer'; diff --git a/client/src/pages/challenges.test.js b/client/src/pages/challenges.test.js index 25d2f79171..0d86029ab0 100644 --- a/client/src/pages/challenges.test.js +++ b/client/src/pages/challenges.test.js @@ -1,4 +1,3 @@ -/* global expect */ import toLearnPath from '../utils/to-learn-path'; import { withPrefix } from 'gatsby'; diff --git a/client/src/redux/failed-updates-epic.test.js b/client/src/redux/failed-updates-epic.test.js index 6d5642b78d..7f3e66eb0e 100644 --- a/client/src/redux/failed-updates-epic.test.js +++ b/client/src/redux/failed-updates-epic.test.js @@ -1,5 +1,3 @@ -/* global expect jest */ - import { Subject } from 'rxjs'; import { ActionsObservable, StateObservable } from 'redux-observable'; import failedUpdatesEpic from './failed-updates-epic'; diff --git a/client/src/redux/ga-saga.test.js b/client/src/redux/ga-saga.test.js index 727f92aee5..bb6a8bf06f 100644 --- a/client/src/redux/ga-saga.test.js +++ b/client/src/redux/ga-saga.test.js @@ -1,5 +1,3 @@ -/* global jest */ - import { types } from '.'; import { createGaSaga } from './ga-saga'; import ga from '../analytics'; diff --git a/client/src/templates/Challenges/components/ChallengeTitle.test.js b/client/src/templates/Challenges/components/ChallengeTitle.test.js index acc47c48ad..6a63f09a8a 100644 --- a/client/src/templates/Challenges/components/ChallengeTitle.test.js +++ b/client/src/templates/Challenges/components/ChallengeTitle.test.js @@ -1,5 +1,3 @@ -/* global expect */ - import React from 'react'; import renderer from 'react-test-renderer'; diff --git a/client/src/templates/Challenges/components/CompletionModal.test.js b/client/src/templates/Challenges/components/CompletionModal.test.js index 370b51232c..fd78bc09f6 100644 --- a/client/src/templates/Challenges/components/CompletionModal.test.js +++ b/client/src/templates/Challenges/components/CompletionModal.test.js @@ -1,5 +1,3 @@ -/* global expect jest */ - import { getCompletedPercent } from './CompletionModal'; jest.mock('../../../analytics'); diff --git a/client/src/templates/Challenges/components/CompletionModalBody.test.js b/client/src/templates/Challenges/components/CompletionModalBody.test.js index 4aca48f988..92827be419 100644 --- a/client/src/templates/Challenges/components/CompletionModalBody.test.js +++ b/client/src/templates/Challenges/components/CompletionModalBody.test.js @@ -1,5 +1,3 @@ -/* global jest, expect */ - import React from 'react'; import { render, fireEvent } from '@testing-library/react'; diff --git a/client/src/templates/Challenges/rechallenge/builders.test.js b/client/src/templates/Challenges/rechallenge/builders.test.js index a62db2e29f..2dd9e3a947 100644 --- a/client/src/templates/Challenges/rechallenge/builders.test.js +++ b/client/src/templates/Challenges/rechallenge/builders.test.js @@ -1,4 +1,3 @@ -/* global expect */ import { findIndexHtml } from './builders.js'; const withHTML = [ diff --git a/client/src/templates/Challenges/redux/create-question-epic.test.js b/client/src/templates/Challenges/redux/create-question-epic.test.js index c613c5e4a4..3e211b0fce 100644 --- a/client/src/templates/Challenges/redux/create-question-epic.test.js +++ b/client/src/templates/Challenges/redux/create-question-epic.test.js @@ -1,5 +1,3 @@ -/* global expect */ - import { transformEditorLink } from '../utils'; describe('create-question-epic', () => { diff --git a/client/src/templates/Challenges/utils/index.test.js b/client/src/templates/Challenges/utils/index.test.js index d86623f5f4..69e459583f 100644 --- a/client/src/templates/Challenges/utils/index.test.js +++ b/client/src/templates/Challenges/utils/index.test.js @@ -1,5 +1,3 @@ -/* global expect */ - import envData from '../../../../../config/env.json'; const { forumLocation } = envData; diff --git a/client/src/templates/Challenges/utils/worker-executor.test.js b/client/src/templates/Challenges/utils/worker-executor.test.js index 0c49360d99..bfecd1ee42 100644 --- a/client/src/templates/Challenges/utils/worker-executor.test.js +++ b/client/src/templates/Challenges/utils/worker-executor.test.js @@ -1,5 +1,3 @@ -/* global expect, jest */ - import createWorker from './worker-executor'; function mockWorker({ init, postMessage, terminate } = {}) { diff --git a/client/src/utils/css-help.test.ts b/client/src/utils/css-help.test.ts index 30f36ff91d..e59836b34a 100644 --- a/client/src/utils/css-help.test.ts +++ b/client/src/utils/css-help.test.ts @@ -1,4 +1,3 @@ -/* global describe it expect */ import { cssString } from './__fixtures/curriculum-helpers-css'; import CSSHelp from './css-help'; diff --git a/client/src/utils/curriculum-helpers.test.js b/client/src/utils/curriculum-helpers.test.js index 337c67cb68..3c8d012151 100644 --- a/client/src/utils/curriculum-helpers.test.js +++ b/client/src/utils/curriculum-helpers.test.js @@ -1,5 +1,3 @@ -/* global describe it expect */ - import __testHelpers, { removeJSComments } from './curriculum-helpers'; import jsTestValues from './__fixtures/curriculum-helpers-javascript'; import cssTestValues from './__fixtures/curriculum-helpers-css'; diff --git a/client/src/utils/format.test.js b/client/src/utils/format.test.js index 05d3817257..66488790a6 100644 --- a/client/src/utils/format.test.js +++ b/client/src/utils/format.test.js @@ -1,4 +1,4 @@ -/* global expect BigInt */ +/* global BigInt */ const { format } = require('./format'); diff --git a/client/src/utils/handled-error.test.js b/client/src/utils/handled-error.test.js index f92fb06608..726b431a52 100644 --- a/client/src/utils/handled-error.test.js +++ b/client/src/utils/handled-error.test.js @@ -1,4 +1,3 @@ -/* global expect jest */ import { isObject } from 'lodash-es'; import { isHandledError, diff --git a/client/utils/gatsby/layoutSelector.test.js b/client/utils/gatsby/layoutSelector.test.js index a0c60bf6e5..f2aa336571 100644 --- a/client/utils/gatsby/layoutSelector.test.js +++ b/client/utils/gatsby/layoutSelector.test.js @@ -1,4 +1,3 @@ -/* global expect jest */ import React from 'react'; import { Provider } from 'react-redux'; import ShallowRenderer from 'react-test-renderer/shallow'; diff --git a/client/utils/tags.test.js b/client/utils/tags.test.js index c0afa042a8..81015051b7 100644 --- a/client/utils/tags.test.js +++ b/client/utils/tags.test.js @@ -1,5 +1,3 @@ -/* global expect */ - import { injectConditionalTags } from './tags'; describe('Tags', () => { diff --git a/curriculum/getChallenges.acceptance.test.js b/curriculum/getChallenges.acceptance.test.js index ba9dca7339..5eb378a54c 100644 --- a/curriculum/getChallenges.acceptance.test.js +++ b/curriculum/getChallenges.acceptance.test.js @@ -1,4 +1,3 @@ -/* global expect */ // TODO: reinstate these tests // // TODO: update these to use the new parser diff --git a/curriculum/getChallenges.test.js b/curriculum/getChallenges.test.js index a42302d1ab..b982d1aeb3 100644 --- a/curriculum/getChallenges.test.js +++ b/curriculum/getChallenges.test.js @@ -1,4 +1,3 @@ -/* global expect */ const path = require('path'); const { diff --git a/curriculum/test/utils/extract-css-comments.test.js b/curriculum/test/utils/extract-css-comments.test.js index 52088f2137..fa449fb06c 100644 --- a/curriculum/test/utils/extract-css-comments.test.js +++ b/curriculum/test/utils/extract-css-comments.test.js @@ -1,4 +1,3 @@ -/* global expect */ const extractCSSComments = require('./extract-css-comments'); const someHTMLWithCSS = ` diff --git a/curriculum/test/utils/extract-html-comments.test.js b/curriculum/test/utils/extract-html-comments.test.js index c1df6fc015..06c0b7e1dc 100644 --- a/curriculum/test/utils/extract-html-comments.test.js +++ b/curriculum/test/utils/extract-html-comments.test.js @@ -1,4 +1,3 @@ -/* global expect */ const extractHTMLComments = require('./extract-html-comments'); const someHTML = ` diff --git a/curriculum/test/utils/extract-js-comments.test.js b/curriculum/test/utils/extract-js-comments.test.js index 910883488d..ead1f5da5a 100644 --- a/curriculum/test/utils/extract-js-comments.test.js +++ b/curriculum/test/utils/extract-js-comments.test.js @@ -1,4 +1,3 @@ -/* global expect */ const extractJSComments = require('./extract-js-comments'); const someJS = ` diff --git a/curriculum/test/utils/extract-jsx-comments.test.js b/curriculum/test/utils/extract-jsx-comments.test.js index 3a6fa7f585..51f3f1d359 100644 --- a/curriculum/test/utils/extract-jsx-comments.test.js +++ b/curriculum/test/utils/extract-jsx-comments.test.js @@ -1,4 +1,3 @@ -/* global expect */ const extractJSXComments = require('./extract-jsx-comments'); const someJSX = ` diff --git a/curriculum/test/utils/sort-challenges.test.js b/curriculum/test/utils/sort-challenges.test.js index 43afcbaf2c..0ad94607c6 100644 --- a/curriculum/test/utils/sort-challenges.test.js +++ b/curriculum/test/utils/sort-challenges.test.js @@ -1,4 +1,3 @@ -/* global expect */ const { sortChallenges } = require('./sort-challenges'); const challenges = [ diff --git a/cypress/integration/learn/index.js b/cypress/integration/learn/index.js index 4f6e08eb58..ea52bc3dfe 100644 --- a/cypress/integration/learn/index.js +++ b/cypress/integration/learn/index.js @@ -1,4 +1,4 @@ -/* global cy expect */ +/* global cy */ const selectors = { challengeMap: "[data-test-label='learn-curriculum-map']" diff --git a/cypress/integration/learn/redirects/challenges.js b/cypress/integration/learn/redirects/challenges.js index b7634e14a3..4a5142732c 100644 --- a/cypress/integration/learn/redirects/challenges.js +++ b/cypress/integration/learn/redirects/challenges.js @@ -1,4 +1,4 @@ -/* global cy expect */ +/* global cy */ const locations = { chalSuper: '/challenges/responsive-web-design/', diff --git a/cypress/integration/settings/certifications.js b/cypress/integration/settings/certifications.js index 88edaebe4b..c64e160e7e 100644 --- a/cypress/integration/settings/certifications.js +++ b/cypress/integration/settings/certifications.js @@ -1,4 +1,4 @@ -/* global cy expect */ +/* global cy */ import '@testing-library/cypress/add-commands'; diff --git a/cypress/integration/settings/settings.js b/cypress/integration/settings/settings.js index 7a057ac5ad..443a128db9 100644 --- a/cypress/integration/settings/settings.js +++ b/cypress/integration/settings/settings.js @@ -1,4 +1,4 @@ -/* global cy expect */ +/* global cy */ describe('Settings', () => { it('should be possible to reset your progress', () => { diff --git a/cypress/integration/user/report-user.js b/cypress/integration/user/report-user.js index 0b0469b1d0..ca5b87c32d 100644 --- a/cypress/integration/user/report-user.js +++ b/cypress/integration/user/report-user.js @@ -1,4 +1,4 @@ -/* global cy expect */ +/* global cy */ describe('Report User', () => { beforeEach(() => { diff --git a/tools/challenge-parser/parser/index.acceptance.test.js b/tools/challenge-parser/parser/index.acceptance.test.js index a323dade33..e92d71af0e 100644 --- a/tools/challenge-parser/parser/index.acceptance.test.js +++ b/tools/challenge-parser/parser/index.acceptance.test.js @@ -1,5 +1,3 @@ -/* global expect */ - const path = require('path'); const { parseMD } = require('.'); diff --git a/tools/challenge-parser/parser/plugins/add-frontmatter.test.js b/tools/challenge-parser/parser/plugins/add-frontmatter.test.js index 209c750bdc..af78cd392f 100644 --- a/tools/challenge-parser/parser/plugins/add-frontmatter.test.js +++ b/tools/challenge-parser/parser/plugins/add-frontmatter.test.js @@ -1,5 +1,3 @@ -/* global describe it expect beforeEach */ - const { isObject } = require('lodash'); const mockAST = require('../__fixtures__/ast-yaml-challenge.json'); diff --git a/tools/challenge-parser/parser/plugins/add-seed.test.js b/tools/challenge-parser/parser/plugins/add-seed.test.js index 034725c661..6489856729 100644 --- a/tools/challenge-parser/parser/plugins/add-seed.test.js +++ b/tools/challenge-parser/parser/plugins/add-seed.test.js @@ -1,4 +1,3 @@ -/* global describe it expect beforeEach */ const isArray = require('lodash/isArray'); const simpleAST = require('../__fixtures__/ast-simple.json'); diff --git a/tools/challenge-parser/parser/plugins/add-solution.test.js b/tools/challenge-parser/parser/plugins/add-solution.test.js index add1a875c8..4618798024 100644 --- a/tools/challenge-parser/parser/plugins/add-solution.test.js +++ b/tools/challenge-parser/parser/plugins/add-solution.test.js @@ -1,4 +1,3 @@ -/* global describe it expect beforeEach */ const mockAST = require('../__fixtures__/ast-simple.json'); const editableSolutionAST = require('../__fixtures__/ast-erm-in-solution.json'); const multiSolnsAST = require('../__fixtures__/ast-multiple-solutions.json'); diff --git a/tools/challenge-parser/parser/plugins/add-tests.test.js b/tools/challenge-parser/parser/plugins/add-tests.test.js index cafb02ed7f..cdb7d1cc6a 100644 --- a/tools/challenge-parser/parser/plugins/add-tests.test.js +++ b/tools/challenge-parser/parser/plugins/add-tests.test.js @@ -1,4 +1,3 @@ -/* global describe it expect beforeEach */ const simpleAST = require('../__fixtures__/ast-simple.json'); const brokenHintsAST = require('../__fixtures__/ast-broken-hints.json'); const addTests = require('./add-tests'); diff --git a/tools/challenge-parser/parser/plugins/add-text.test.js b/tools/challenge-parser/parser/plugins/add-text.test.js index c46d8d07b3..d020a954d2 100644 --- a/tools/challenge-parser/parser/plugins/add-text.test.js +++ b/tools/challenge-parser/parser/plugins/add-text.test.js @@ -1,4 +1,3 @@ -/* global describe it expect */ const mockAST = require('../__fixtures__/ast-simple.json'); // eslint-disable-next-line max-len const incorrectMarkersAST = require('../__fixtures__/ast-incorrect-markers.json'); diff --git a/tools/challenge-parser/parser/plugins/add-video-question.test.js b/tools/challenge-parser/parser/plugins/add-video-question.test.js index 2da46a9368..2c2f427e09 100644 --- a/tools/challenge-parser/parser/plugins/add-video-question.test.js +++ b/tools/challenge-parser/parser/plugins/add-video-question.test.js @@ -1,4 +1,3 @@ -/* global describe it expect beforeEach */ const simpleAST = require('../__fixtures__/ast-simple.json'); const mockVideoAST = require('../__fixtures__/ast-video-challenge.json'); // eslint-disable-next-line max-len diff --git a/tools/challenge-parser/parser/plugins/replace-imports.test.js b/tools/challenge-parser/parser/plugins/replace-imports.test.js index 24232dbb64..6d638e577b 100644 --- a/tools/challenge-parser/parser/plugins/replace-imports.test.js +++ b/tools/challenge-parser/parser/plugins/replace-imports.test.js @@ -1,4 +1,3 @@ -/* global describe it expect jest */ const path = require('path'); const cloneDeep = require('lodash/cloneDeep'); const toVfile = require('to-vfile'); diff --git a/tools/challenge-parser/parser/plugins/restore-directives.test.js b/tools/challenge-parser/parser/plugins/restore-directives.test.js index dc597317d3..f65dbed02f 100644 --- a/tools/challenge-parser/parser/plugins/restore-directives.test.js +++ b/tools/challenge-parser/parser/plugins/restore-directives.test.js @@ -1,4 +1,3 @@ -/* global describe it expect */ const cloneDeep = require('lodash/cloneDeep'); const { selectAll } = require('unist-util-select'); const find = require('unist-util-find'); diff --git a/tools/challenge-parser/parser/plugins/utils/between-headings.test.js b/tools/challenge-parser/parser/plugins/utils/between-headings.test.js index c68de36a89..164c401e61 100644 --- a/tools/challenge-parser/parser/plugins/utils/between-headings.test.js +++ b/tools/challenge-parser/parser/plugins/utils/between-headings.test.js @@ -1,4 +1,3 @@ -/* global expect*/ const isArray = require('lodash/isArray'); const find = require('unist-util-find'); const { root } = require('mdast-builder'); diff --git a/tools/challenge-parser/parser/plugins/utils/get-id.test.js b/tools/challenge-parser/parser/plugins/utils/get-id.test.js index e67a314df2..affbbc8f8c 100644 --- a/tools/challenge-parser/parser/plugins/utils/get-id.test.js +++ b/tools/challenge-parser/parser/plugins/utils/get-id.test.js @@ -1,4 +1,3 @@ -/* global expect*/ const getId = require('./get-id'); const idNode = require('./__fixtures__/id-node.json'); const imageNode = require('./__fixtures__/image-node.json'); diff --git a/tools/challenge-parser/parser/plugins/utils/mdast-to-html.test.js b/tools/challenge-parser/parser/plugins/utils/mdast-to-html.test.js index eb0b72af63..3177adea29 100644 --- a/tools/challenge-parser/parser/plugins/utils/mdast-to-html.test.js +++ b/tools/challenge-parser/parser/plugins/utils/mdast-to-html.test.js @@ -1,4 +1,3 @@ -/* global expect*/ const mdastToHTML = require('./mdast-to-html'); const mdastMixedNodes = require('./__fixtures__/mdast-mixed-nodes.json'); const mdastWithEmNode = require('./__fixtures__/mdast-with-em.json'); diff --git a/tools/challenge-parser/translation-parser/index.test.js b/tools/challenge-parser/translation-parser/index.test.js index 8e38194909..98f097fbc8 100644 --- a/tools/challenge-parser/translation-parser/index.test.js +++ b/tools/challenge-parser/translation-parser/index.test.js @@ -1,4 +1,3 @@ -/* global expect jest */ const { translateComments, translateCommentsInChallenge, diff --git a/tools/scripts/lint/index.test.js b/tools/scripts/lint/index.test.js index fa06f3fbd9..02e924b5a9 100644 --- a/tools/scripts/lint/index.test.js +++ b/tools/scripts/lint/index.test.js @@ -1,4 +1,3 @@ -/* global describe it expect jest beforeEach */ const path = require('path'); const lint = require('.'); diff --git a/tools/ui-components/src/button.test.js b/tools/ui-components/src/button.test.js index b9dd3a9429..31f57bb2a0 100644 --- a/tools/ui-components/src/button.test.js +++ b/tools/ui-components/src/button.test.js @@ -1,6 +1,3 @@ -/* global expect */ -/* global jest */ - import React from 'react'; import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; diff --git a/utils/get-lines.test.js b/utils/get-lines.test.js index c9a46bf7c5..2de1f1c057 100644 --- a/utils/get-lines.test.js +++ b/utils/get-lines.test.js @@ -1,5 +1,3 @@ -/* global describe expect it */ - const { getLines } = require('./get-lines'); const content = 'one\ntwo\nthree'; diff --git a/utils/slugs.test.js b/utils/slugs.test.js index bf5ab6d160..8e37e601f3 100644 --- a/utils/slugs.test.js +++ b/utils/slugs.test.js @@ -1,5 +1,3 @@ -/* global describe expect it */ - const slugs = require('./slugs'); describe('dasherize', () => { diff --git a/utils/sort-files.test.js b/utils/sort-files.test.js index 244caf6397..19955ab04d 100644 --- a/utils/sort-files.test.js +++ b/utils/sort-files.test.js @@ -1,5 +1,3 @@ -/* global expect */ - const { toSortedArray } = require('./sort-files'); const { challengeFiles } = require('./__fixtures__/challenges'); diff --git a/utils/validate.test.js b/utils/validate.test.js index f5c84f20e8..ab40a57f9c 100644 --- a/utils/validate.test.js +++ b/utils/validate.test.js @@ -1,5 +1,3 @@ -/* global describe expect it */ - const { isValidUsername, usernameTooShort,