chore: add jest global variables (#42573)
This commit is contained in:
@ -3,7 +3,8 @@
|
||||
"es6": true,
|
||||
"browser": true,
|
||||
"mocha": true,
|
||||
"node": true
|
||||
"node": true,
|
||||
"jest": true
|
||||
},
|
||||
"parser": "babel-eslint",
|
||||
"root": true,
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
import { ensureLowerCaseEmail } from './User-Identity';
|
||||
|
||||
test('returns lowercase email when one exists', () => {
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global it expect */
|
||||
|
||||
import { getFallbackFrontEndDate } from '../boot/certificate';
|
||||
import { fullStackChallenges } from './fixtures';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global describe xdescribe it expect jest */
|
||||
import { first, find } from 'lodash';
|
||||
|
||||
import {
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global jest*/
|
||||
import { isEqual } from 'lodash';
|
||||
import { isEmail } from 'validator';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global describe it expect jest */
|
||||
import { mockReq as mockRequest, mockRes } from '../boot_tests/challenge.test';
|
||||
import jwt from 'jsonwebtoken';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global describe expect it */
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
import { dayCount } from './date-utils';
|
||||
|
@ -1,7 +1,4 @@
|
||||
/* eslint-disable camelcase */
|
||||
/* global describe it expect */
|
||||
/* global jest*/
|
||||
|
||||
import axios from 'axios';
|
||||
import keys from '../../../../config/secrets';
|
||||
import {
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global describe it expect */
|
||||
import {
|
||||
getAccessTokenFromRequest,
|
||||
errorTypes,
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global describe beforeEach expect it jest */
|
||||
import inMemoryCache from './in-memory-cache';
|
||||
|
||||
describe('InMemoryCache', () => {
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global describe expect it jest */
|
||||
|
||||
const jwt = require('jsonwebtoken');
|
||||
|
||||
const { getReturnTo, normalizeParams } = require('./redirection');
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global describe it expect jest */
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
import {
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
import {
|
||||
availableLangs,
|
||||
langDisplayNames,
|
||||
|
1
client/src/__mocks__/react-i18nextMock.js
vendored
1
client/src/__mocks__/react-i18nextMock.js
vendored
@ -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');
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global describe it expect */
|
||||
import {
|
||||
wrapHandledError,
|
||||
unwrapHandledError
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global jest, expect */
|
||||
import React from 'react';
|
||||
import ShallowRenderer from 'react-test-renderer/shallow';
|
||||
import envData from '../../../config/env.json';
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect jest */
|
||||
import React from 'react';
|
||||
import ShallowRenderer from 'react-test-renderer/shallow';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect jest */
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import { Provider } from 'react-redux';
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect jest */
|
||||
|
||||
import React from 'react';
|
||||
import { useStaticQuery } from 'gatsby';
|
||||
import { render } from '@testing-library/react';
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect */
|
||||
|
||||
import createExternalRedirect from './createExternalRedirects';
|
||||
|
||||
describe('createExternalRedirects', () => {
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect */
|
||||
|
||||
import createLanguageRedirect from './createLanguageRedirect';
|
||||
|
||||
describe('createLanguageRedirect for clientLocale === english', () => {
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect */
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect */
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global jest, expect */
|
||||
|
||||
import React from 'react';
|
||||
import { render, fireEvent } from '@testing-library/react';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
import React from 'react';
|
||||
import { render, cleanup } from '@testing-library/react';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect jest */
|
||||
import React from 'react';
|
||||
import ShallowRenderer from 'react-test-renderer/shallow';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect jest */
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect jest */
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect */
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import TimeLine from './TimeLine';
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global jest, expect */
|
||||
import React from 'react';
|
||||
import ShallowRenderer from 'react-test-renderer/shallow';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect jest */
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import { Provider } from 'react-redux';
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect jest */
|
||||
import React from 'react';
|
||||
import ShallowRenderer from 'react-test-renderer/shallow';
|
||||
import TestRenderer from 'react-test-renderer';
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
import toLearnPath from '../utils/to-learn-path';
|
||||
import { withPrefix } from 'gatsby';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect jest */
|
||||
|
||||
import { Subject } from 'rxjs';
|
||||
import { ActionsObservable, StateObservable } from 'redux-observable';
|
||||
import failedUpdatesEpic from './failed-updates-epic';
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global jest */
|
||||
|
||||
import { types } from '.';
|
||||
import { createGaSaga } from './ga-saga';
|
||||
import ga from '../analytics';
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect */
|
||||
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect jest */
|
||||
|
||||
import { getCompletedPercent } from './CompletionModal';
|
||||
|
||||
jest.mock('../../../analytics');
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global jest, expect */
|
||||
|
||||
import React from 'react';
|
||||
import { render, fireEvent } from '@testing-library/react';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
import { findIndexHtml } from './builders.js';
|
||||
|
||||
const withHTML = [
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect */
|
||||
|
||||
import { transformEditorLink } from '../utils';
|
||||
|
||||
describe('create-question-epic', () => {
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect */
|
||||
|
||||
import envData from '../../../../../config/env.json';
|
||||
|
||||
const { forumLocation } = envData;
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect, jest */
|
||||
|
||||
import createWorker from './worker-executor';
|
||||
|
||||
function mockWorker({ init, postMessage, terminate } = {}) {
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global describe it expect */
|
||||
import { cssString } from './__fixtures/curriculum-helpers-css';
|
||||
import CSSHelp from './css-help';
|
||||
|
||||
|
@ -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';
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* global expect BigInt */
|
||||
/* global BigInt */
|
||||
|
||||
const { format } = require('./format');
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect jest */
|
||||
import { isObject } from 'lodash-es';
|
||||
import {
|
||||
isHandledError,
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect jest */
|
||||
import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import ShallowRenderer from 'react-test-renderer/shallow';
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect */
|
||||
|
||||
import { injectConditionalTags } from './tags';
|
||||
|
||||
describe('Tags', () => {
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
// TODO: reinstate these tests
|
||||
|
||||
// // TODO: update these to use the new parser
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
const path = require('path');
|
||||
|
||||
const {
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
const extractCSSComments = require('./extract-css-comments');
|
||||
|
||||
const someHTMLWithCSS = `<body>
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
const extractHTMLComments = require('./extract-html-comments');
|
||||
|
||||
const someHTML = `<body>
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
const extractJSComments = require('./extract-js-comments');
|
||||
|
||||
const someJS = `
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
const extractJSXComments = require('./extract-jsx-comments');
|
||||
|
||||
const someJSX = `<Link
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
const extractScriptJSComments = require('./extract-script-js-comments');
|
||||
|
||||
const inlineComments = `<body>
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect */
|
||||
const { sortChallenges } = require('./sort-challenges');
|
||||
|
||||
const challenges = [
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* global cy expect */
|
||||
/* global cy */
|
||||
|
||||
const selectors = {
|
||||
challengeMap: "[data-test-label='learn-curriculum-map']"
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* global cy expect */
|
||||
/* global cy */
|
||||
|
||||
const locations = {
|
||||
chalSuper: '/challenges/responsive-web-design/',
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* global cy expect */
|
||||
/* global cy */
|
||||
|
||||
import '@testing-library/cypress/add-commands';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* global cy expect */
|
||||
/* global cy */
|
||||
|
||||
describe('Settings', () => {
|
||||
it('should be possible to reset your progress', () => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* global cy expect */
|
||||
/* global cy */
|
||||
|
||||
describe('Report User', () => {
|
||||
beforeEach(() => {
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect */
|
||||
|
||||
const path = require('path');
|
||||
|
||||
const { parseMD } = require('.');
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global describe it expect beforeEach */
|
||||
|
||||
const { isObject } = require('lodash');
|
||||
|
||||
const mockAST = require('../__fixtures__/ast-yaml-challenge.json');
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global describe it expect beforeEach */
|
||||
const isArray = require('lodash/isArray');
|
||||
|
||||
const simpleAST = require('../__fixtures__/ast-simple.json');
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global describe it expect jest */
|
||||
const path = require('path');
|
||||
const cloneDeep = require('lodash/cloneDeep');
|
||||
const toVfile = require('to-vfile');
|
||||
|
@ -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');
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect*/
|
||||
const isArray = require('lodash/isArray');
|
||||
const find = require('unist-util-find');
|
||||
const { root } = require('mdast-builder');
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global expect jest */
|
||||
const {
|
||||
translateComments,
|
||||
translateCommentsInChallenge,
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global describe it expect jest beforeEach */
|
||||
const path = require('path');
|
||||
|
||||
const lint = require('.');
|
||||
|
@ -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';
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global describe expect it */
|
||||
|
||||
const { getLines } = require('./get-lines');
|
||||
|
||||
const content = 'one\ntwo\nthree';
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global describe expect it */
|
||||
|
||||
const slugs = require('./slugs');
|
||||
|
||||
describe('dasherize', () => {
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global expect */
|
||||
|
||||
const { toSortedArray } = require('./sort-files');
|
||||
const { challengeFiles } = require('./__fixtures__/challenges');
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* global describe expect it */
|
||||
|
||||
const {
|
||||
isValidUsername,
|
||||
usernameTooShort,
|
||||
|
Reference in New Issue
Block a user