Skip to content

Commit

Permalink
Remove redundant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nekiro committed Dec 1, 2024
1 parent 6dd1bf6 commit 390ea44
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 537 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sha1Encrypt } from "../../../lib/crypt";
import { sha1Encrypt } from "@lib/crypt";
import crypto from "crypto";

describe("sha1Encrypt", () => {
Expand All @@ -23,9 +23,7 @@ describe("sha1Encrypt", () => {
digest: jest.fn().mockReturnValueOnce("foo"),
};

const createHashSpy = jest
.spyOn(crypto, "createHash")
.mockImplementationOnce(() => hashMock as unknown as crypto.Hash);
const createHashSpy = jest.spyOn(crypto, "createHash").mockImplementationOnce(() => hashMock as unknown as crypto.Hash);

const result = await sha1Encrypt(mockedInput);

Expand Down
16 changes: 8 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// jest.config.js
const nextJest = require('next/jest');
const nextJest = require("next/jest");

const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: './',
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: "./",
});

// Add any custom config to be passed to Jest
const customJestConfig = {
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
testMatch: ['**/?(*.)+(spec|test).(t|j)s?(x)'],
clearMocks: true,
setupFilesAfterEnv: ['<rootDir>/src/singleton.ts'],
moduleDirectories: ["node_modules", "<rootDir>/"],
testEnvironment: "jest-environment-jsdom",
testMatch: ["<rootDir>/__tests__/**/*.(spec|test).(t|j)s?(x)"],
clearMocks: true,
setupFilesAfterEnv: ["<rootDir>/src/singleton.ts"],
};

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
Expand Down
43 changes: 43 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"devDependencies": {
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@types/jest": "^29.5.14",
"@types/mercadopago": "^1.5.11",
"@types/node-cron": "^3.0.11",
"@types/react": "^18.3.12",
Expand Down
22 changes: 0 additions & 22 deletions src/__tests__/api/accounts/login.test.js

This file was deleted.

23 changes: 0 additions & 23 deletions src/__tests__/api/accounts/register.test.js

This file was deleted.

69 changes: 0 additions & 69 deletions src/__tests__/middleware/apiHandler.test.ts

This file was deleted.

78 changes: 0 additions & 78 deletions src/__tests__/middleware/validation.test.ts

This file was deleted.

57 changes: 0 additions & 57 deletions src/__tests__/services/account/createAccount.test.ts

This file was deleted.

Loading

0 comments on commit 390ea44

Please sign in to comment.