Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Remove unused test configurations and dependencies #3123

Merged
merged 6 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/workflows/ci-test-job-launcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ on:
workflow_dispatch:

jobs:
job-launcher-client-test:
name: Job Launcher Client Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn workspace @human-protocol/job-launcher-client test
name: Run Job Launcher Client test
job-launcher-server-test:
name: Job Launcher Server Test
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repository": "https://github.com/humanprotocol/human-protocol",
"license": "MIT",
"scripts": {
"test": "concurrently \"yarn workspace @human-protocol/core test\" \"yarn workspace @human-protocol/sdk test\" \"yarn workspace @human-protocol/subgraph test\" \"yarn workspace @human-protocol/faucet-server test\" \"yarn workspace @human-protocol/job-launcher-server test\" \"yarn workspace @human-protocol/job-launcher-client test\" \"yarn workspace @human-protocol/human-app-frontend test\" \"yarn workspace @human-protocol/human-app-server test\" \"yarn workspace @human-protocol/reputation-oracle test\" \"yarn workspace @human-protocol/fortune-exchange-oracle-server test\" \"yarn workspace @human-protocol/fortune-recording-oracle test\"",
"lint": "concurrently \"yarn workspace @human-protocol/core lint\" \"yarn workspace @human-protocol/sdk lint\" \"yarn workspace @human-protocol/subgraph lint\" \"yarn workspace @human-protocol/faucet-client lint\" \"yarn workspace @human-protocol/faucet-server lint\" \"yarn workspace @human-protocol/job-launcher-server lint\" \"yarn workspace @human-protocol/job-launcher-client lint\" \"yarn workspace @human-protocol/human-app-frontend lint\" \"yarn workspace @human-protocol/human-app-server lint\" \"yarn workspace @human-protocol/reputation-oracle lint\" \"yarn workspace @human-protocol/fortune-exchange-oracle-server lint\" \"yarn workspace @human-protocol/fortune-recording-oracle lint\" \"yarn workspace @human-protocol/dashboard-client lint\"",
"test": "concurrently \"yarn workspace @human-protocol/core test\" \"yarn workspace @human-protocol/sdk test\" \"yarn workspace @human-protocol/subgraph test\" \"yarn workspace @human-protocol/faucet-server test\" \"yarn workspace @human-protocol/job-launcher-server test\" \"yarn workspace @human-protocol/human-app-frontend test\" \"yarn workspace @human-protocol/human-app-server test\" \"yarn workspace @human-protocol/reputation-oracle test\" \"yarn workspace @human-protocol/fortune-exchange-oracle-server test\" \"yarn workspace @human-protocol/fortune-recording-oracle test\"",
"lint": "concurrently \"yarn workspace @human-protocol/core lint\" \"yarn workspace @human-protocol/sdk lint\" \"yarn workspace @human-protocol/subgraph lint\" \"yarn workspace @human-protocol/faucet-client lint\" \"yarn workspace @human-protocol/faucet-server lint\" \"yarn workspace @human-protocol/job-launcher-server lint\" \"yarn workspace @human-protocol/job-launcher-client lint\" \"yarn workspace @human-protocol/human-app-frontend lint\" \"yarn workspace @human-protocol/human-app-server lint\" \"yarn workspace @human-protocol/reputation-oracle lint\" \"yarn workspace @human-protocol/fortune-exchange-oracle-server lint\" \"yarn workspace @human-protocol/fortune-recording-oracle lint\" \"yarn workspace @human-protocol/dashboard-client lint\" \"yarn workspace @human-protocol/staking-dashboard-client lint\"",
"prepare": "husky",
"postinstall": "yarn workspace @human-protocol/sdk build"
},
Expand Down
1 change: 0 additions & 1 deletion packages/apps/dashboard/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"type": "module",
"scripts": {
"start": "vite",
"test": "vitest -u",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
Expand Down
6 changes: 0 additions & 6 deletions packages/apps/faucet/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
<h1 align="center">HUMAN Faucet</h1>
<p align="center">The HUMAN Faucet allows users to claim small amounts of HMT tokens to test and explore functionalities within the HUMAN Protocol ecosystem.</p>

<p align="center">
<a href="https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-faucet-ui.yaml">
<img src="https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-faucet-ui.yaml/badge.svg?branch=main" alt="Faucet Check">
</a>
</p>

## ✨ Demo

First, install the dependencies using `yarn` as the package manager:
Expand Down
4 changes: 1 addition & 3 deletions packages/apps/faucet/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^5.1.0",
"vite": "^6.2.0",
"vite-plugin-node-polyfills": "^0.22.0",
"vitest": "^1.6.0"
"vite-plugin-node-polyfills": "^0.22.0"
},
"scripts": {
"lint": "eslint '**/*.{ts,tsx}'",
"start": "vite",
"build": "vite build",
"preview": "vite preview",
"start-prod": "serve -s dist",
"test": "vitest -u",
"format:prettier": "prettier --write '**/*.{ts,tsx}'",
"format:lint": "eslint --fix '**/*.{ts,tsx}'",
"format": "yarn format:prettier && yarn format:lint",
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/faucet/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"resolveJsonModule": true,
"downlevelIteration": true,
"baseUrl": "./",
"types": ["node", "jest", "@testing-library/jest-dom"]
"types": ["node"]
},
"include": ["src", "tests"]
"include": ["src"]
}
13 changes: 1 addition & 12 deletions packages/apps/faucet/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,7 @@ export default defineConfig(({ mode }) => {
plugins: () => react(),
},
resolve: {
alias: [
{ find: 'src', replacement: path.resolve(__dirname, 'src') },
{ find: 'tests', replacement: path.resolve(__dirname, 'tests') },
],
},
test: {
globals: true,
environment: 'happy-dom',
setupFiles: './tests/setup.ts',
coverage: {
reporter: ['text', 'json', 'html'],
},
alias: [{ find: 'src', replacement: path.resolve(__dirname, 'src') }],
},
optimizeDeps: {
include: ['@human-protocol/sdk'],
Expand Down
1 change: 0 additions & 1 deletion packages/apps/fortune/exchange-oracle/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"build": "vite build",
"preview": "vite preview",
"start:prod": "serve -s dist",
"test": "vitest run -u",
"format:prettier": "prettier --write \"**/*.{ts,tsx,js,jsx}\"",
"format:lint": "eslint --fix \"**/*.{ts,tsx,js,jsx}\"",
"format": "yarn format:prettier && yarn format:lint"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="vitest" />
/// <reference types="vite/client" />

import path from 'path';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,34 +164,34 @@ describe('TransformEnumInterceptor', () => {

it('should return bodyOrQuery if instance is not an object', () => {
// Test with `null` as the instance
let result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
let result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
null,
MockDto
MockDto,
);
expect(result).toEqual({ status: 'PENDING' });

// Test with `undefined` as the instance
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
undefined,
MockDto
MockDto,
);
expect(result).toEqual({ status: 'PENDING' });

// Test with a primitive value (string) as the instance
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
'some string',
MockDto
MockDto,
);
expect(result).toEqual({ status: 'PENDING' });

// Test with a primitive value (number) as the instance
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
123,
MockDto
MockDto,
);
expect(result).toEqual({ status: 'PENDING' });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export class WebhookController {
status: 404,
description: 'Not Found. Could not find the requested content.',
})
public async processWebhook(
@Body() body: WebhookDto,
): Promise<void> {
public async processWebhook(@Body() body: WebhookDto): Promise<void> {
return this.webhookService.handleWebhook(body);
}
}
7 changes: 1 addition & 6 deletions packages/apps/human-app/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"start:prod": "serve -s dist",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"test": "vitest",
"prepare": "husky"
},
"lint-staged": {
Expand Down Expand Up @@ -54,8 +53,6 @@
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.60.1",
"@tanstack/react-query-devtools": "^5.59.16",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^15.0.7",
"@types/lodash": "^4.17.12",
"@types/mui-image": "^1.0.5",
"@types/node": "^22.10.5",
Expand All @@ -64,7 +61,6 @@
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@vercel/style-guide": "^6.0.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/ui": "^2.1.1",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
Expand All @@ -74,7 +70,6 @@
"lint-staged": "^15.4.3",
"prettier": "^3.4.2",
"typescript": "^5.6.3",
"vite": "^6.2.0",
"vitest": "^1.2.2"
"vite": "^6.2.0"
}
}
20 changes: 0 additions & 20 deletions packages/apps/human-app/frontend/src/setup-tests.ts

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 1 addition & 6 deletions packages/apps/human-app/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
"useDefineForClassFields": true,
"module": "Preserve",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"types": [
"vite-plugin-svgr/client",
"vite/client",
"vitest/globals",
"@testing-library/jest-dom"
],
"types": ["vite-plugin-svgr/client", "vite/client", "vitest/globals"],
"strictNullChecks": true,

/* Bundler mode */
Expand Down
6 changes: 0 additions & 6 deletions packages/apps/human-app/frontend/vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ const config = defineConfig({
'@': path.resolve(__dirname, './src'),
},
},
test: {
environment: 'jsdom',
globals: true,
includeSource: ['./src/**/*.{ts,tsx}'],
setupFiles: ['./src/setup-tests.ts/'],
},
build: {
target: 'esnext',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,34 +203,34 @@ describe('TransformEnumInterceptor', () => {

it('should return bodyOrQuery if instance is not an object', () => {
// Test with `null` as the instance
let result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
let result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
null,
MockDto
MockDto,
);
expect(result).toEqual({ status: 'PENDING' });

// Test with `undefined` as the instance
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
undefined,
MockDto
MockDto,
);
expect(result).toEqual({ status: 'PENDING' });

// Test with a primitive value (string) as the instance
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
'some string',
MockDto
MockDto,
);
expect(result).toEqual({ status: 'PENDING' });

// Test with a primitive value (number) as the instance
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
result = interceptor['lowercaseEnumProperties'](
{ status: 'PENDING' },
123,
MockDto
MockDto,
);
expect(result).toEqual({ status: 'PENDING' });
});
Expand Down
Loading