fix: remove duplicate jest globals imports inside tests files (#4541)

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
Ophelia Goldstein
2025-10-08 01:42:04 +03:00
committed by GitHub
co-authored by Alexandr
parent e9cc6c0556
commit 12caf46c6d
8 changed files with 23 additions and 16 deletions
+8 -2
View File
@@ -1,13 +1,19 @@
// @ts-check
import { beforeEach, jest } from "@jest/globals";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
import api from "../api/index.js";
import { calculateRank } from "../src/calculateRank.js";
import { renderStatsCard } from "../src/cards/stats.js";
import { CONSTANTS, renderError } from "../src/common/utils.js";
import { expect, it, describe, afterEach } from "@jest/globals";
import {
expect,
it,
describe,
afterEach,
beforeEach,
jest,
} from "@jest/globals";
/**
* @type {import("../src/fetchers/stats").StatsData}
+1 -2
View File
@@ -1,10 +1,9 @@
// @ts-check
import { jest } from "@jest/globals";
import "@testing-library/jest-dom";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
import { expect, it, describe, afterEach } from "@jest/globals";
import { expect, it, describe, afterEach, jest } from "@jest/globals";
import { renderGistCard } from "../src/cards/gist.js";
import { CONSTANTS, renderError } from "../src/common/utils.js";
import gist from "../api/gist.js";
+8 -2
View File
@@ -4,11 +4,17 @@
import dotenv from "dotenv";
dotenv.config();
import { jest } from "@jest/globals";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
import patInfo, { RATE_LIMIT_SECONDS } from "../api/status/pat-info.js";
import { expect, it, describe, afterEach, beforeAll } from "@jest/globals";
import {
expect,
it,
describe,
afterEach,
beforeAll,
jest,
} from "@jest/globals";
const mock = new MockAdapter(axios);
+1 -2
View File
@@ -1,13 +1,12 @@
// @ts-check
import { jest } from "@jest/globals";
import "@testing-library/jest-dom";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
import pin from "../api/pin.js";
import { renderRepoCard } from "../src/cards/repo.js";
import { CONSTANTS, renderError } from "../src/common/utils.js";
import { expect, it, describe, afterEach } from "@jest/globals";
import { expect, it, describe, afterEach, jest } from "@jest/globals";
const data_repo = {
repository: {
+1 -2
View File
@@ -1,8 +1,7 @@
import { jest } from "@jest/globals";
import "@testing-library/jest-dom";
import { retryer, RETRIES } from "../src/common/retryer.js";
import { logger } from "../src/common/utils.js";
import { expect, it, describe } from "@jest/globals";
import { expect, it, describe, jest } from "@jest/globals";
const fetcher = jest.fn((variables, token) => {
logger.log(variables, token);
+2 -2
View File
@@ -1,11 +1,11 @@
/**
* @file Tests for the status/up cloud function.
*/
import { jest } from "@jest/globals";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
import up, { RATE_LIMIT_SECONDS } from "../api/status/up.js";
import { expect, it, describe, afterEach } from "@jest/globals";
import { expect, it, describe, afterEach, jest } from "@jest/globals";
const mock = new MockAdapter(axios);
+1 -2
View File
@@ -1,13 +1,12 @@
// @ts-check
import { jest } from "@jest/globals";
import "@testing-library/jest-dom";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
import topLangs from "../api/top-langs.js";
import { renderTopLanguages } from "../src/cards/top-languages.js";
import { CONSTANTS, renderError } from "../src/common/utils.js";
import { expect, it, describe, afterEach } from "@jest/globals";
import { expect, it, describe, afterEach, jest } from "@jest/globals";
const data_langs = {
data: {
+1 -2
View File
@@ -1,10 +1,9 @@
import { jest } from "@jest/globals";
import "@testing-library/jest-dom";
import axios from "axios";
import MockAdapter from "axios-mock-adapter";
import wakatime from "../api/wakatime.js";
import { renderWakatimeCard } from "../src/cards/wakatime.js";
import { expect, it, describe, afterEach } from "@jest/globals";
import { expect, it, describe, afterEach, jest } from "@jest/globals";
const wakaTimeData = {
data: {