Skip to content

Comments

restructure tests, add tests, remove dotenv#83

Merged
martin-mfg merged 18 commits intomasterfrom
test-coverage
Feb 20, 2026
Merged

restructure tests, add tests, remove dotenv#83
martin-mfg merged 18 commits intomasterfrom
test-coverage

Conversation

@martin-mfg
Copy link
Member

  • add a few tests
  • re-organize tests to allow testing with different env vars and creating a combined coverage report
  • extract test data into separate files, because importing data from testA in testB leads to weird jest errors
  • remove dotenv because it's not being used
  • "GitHub Trends" -> "GitHub Stats Extended"

@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
github-stats-extended-backend Ready Ready Preview, Comment Feb 20, 2026 6:36pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
github-stats-extended-frontend Skipped Skipped Feb 20, 2026 6:36pm

// @ts-check

import { afterEach, describe, expect, it, jest } from "@jest/globals";
import "@testing-library/jest-dom";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this. There are no DOM assertions.

// @ts-check

import { afterEach, describe, expect, it, jest } from "@jest/globals";
import "@testing-library/jest-dom";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this. There are no DOM assertions.

// @ts-check

import { afterEach, describe, expect, it, jest } from "@jest/globals";
import "@testing-library/jest-dom";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this. There are no DOM assertions.


import { afterEach, describe, expect, it, jest } from "@jest/globals";
import "@testing-library/jest-dom";
import axios from "axios";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this. There are no DOM assertions.

// @ts-check

import { afterEach, describe, expect, it, jest } from "@jest/globals";
import "@testing-library/jest-dom";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this. There are no DOM assertions.

"<rootDir>/tests/e2e/",
],
testRegex: "(\\.bench)\\.(ts|tsx|js)$",
testMatch: ["<rootDir>/tests/bench/*.bench.{ts,tsx,js}"],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
testMatch: ["<rootDir>/tests/bench/*.bench.{ts,tsx,js}"],
testMatch: ["<rootDir>/tests/bench/*.bench.{ts,js}"],

I don't think we will have tsx files in backend

testEnvironment: "node",
coverageProvider: "v8",
testMatch: ["<rootDir>/tests/e2e/**/*.test.js"],
testMatch: ["<rootDir>/tests/e2e/*.test.{ts,tsx,js}"],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we will have tsx files in backend

Suggested change
testMatch: ["<rootDir>/tests/e2e/*.test.{ts,tsx,js}"],
testMatch: ["<rootDir>/tests/e2e/*.test.{ts,js}"],

testEnvironment: "jsdom",
testMatch: [
"<rootDir>/tests/*.test.{ts,tsx,js}",
"<rootDir>/tests/private-instance/*.test.{ts,tsx,js}",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"<rootDir>/tests/private-instance/*.test.{ts,tsx,js}",
"<rootDir>/tests/private-instance/*.test.{ts,js}",

I don't think we will have tsx files in backend

Comment on lines 6 to 7
"<rootDir>/tests/*.test.{ts,tsx,js}",
"<rootDir>/tests/public-instance/*.test.{ts,tsx,js}",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"<rootDir>/tests/*.test.{ts,tsx,js}",
"<rootDir>/tests/public-instance/*.test.{ts,tsx,js}",
"<rootDir>/tests/*.test.{ts,js}",
"<rootDir>/tests/public-instance/*.test.{ts,js}",

I don't think we will have tsx files in backend

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed few type errors:

Image

Maybe they are false positives and types need to be updated. I think we can take care of that once we migrate to typescript.

@vercel vercel bot temporarily deployed to Preview – github-stats-extended-frontend February 20, 2026 18:35 Inactive
@martin-mfg martin-mfg merged commit 6e109e5 into master Feb 20, 2026
7 checks passed
@martin-mfg martin-mfg deleted the test-coverage branch February 20, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants