Skip to content

Commit

Permalink
[REFACTOR]: Frontend: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
helabenkhalfallah committed Feb 26, 2025
1 parent a9fccf9 commit 322f3d5
Show file tree
Hide file tree
Showing 104 changed files with 3,136 additions and 2,293 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Steps to reproduce the behavior:
3. Scroll down to '....'
4. See error

### Expected Behavior
### Expected Behavior
A clear and concise description of what you expected to happen.

### ❌ Actual Behavior
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## 📄 Description
Please explain in detail what this PR does, why it is needed, and how it addresses a specific problem. Include any relevant context and background information.

## Checklist
## Checklist
- [ ] I have read and followed the [Contribution Guide](https://github.com/ekino/v6y/wiki/Contribution-Guide).
- [ ] My code follows the style guidelines of this project.
- [ ] I have performed a self-review of my own code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { auditStatus } from '@v6y/core-logic';
import { devOpsCategories, devOpsType } from '@v6y/core-logic/src/config/DevOpsConfig.ts';
import { describe, expect, it } from 'vitest';

import DoraMetricsUtils from './DoraMetricsUtils.ts';
import mockDeployments from './mockDeploymentsData.json' with { type: 'json' };
import mockMergeRequests from './mockMergeRequestsData.json' with { type: 'json' };
import DoraMetricsUtils from '../auditors/dora-metrics/DoraMetricsUtils.ts';
import mockDeployments from '../auditors/dora-metrics/mockDeploymentsData.json' with { type: 'json' };
import mockMergeRequests from '../auditors/dora-metrics/mockMergeRequestsData.json' with { type: 'json' };

const mockApplication = { _id: 1, name: 'TestApp' };
const mockDateRange = { dateStart: '2025-02-01', dateEnd: '2025-02-10' };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';

import LighthouseConfig from './LighthouseConfig.ts';
import LighthouseConfig from '../auditors/lighthouse/LighthouseConfig.ts';

// Adjust the path accordingly

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import { AuditType, auditStatus } from '@v6y/core-logic';
import { describe, expect, it } from 'vitest';

import LighthouseUtils from '../auditors/lighthouse/LighthouseUtils.ts';
import {
LighthouseAuditCategoryType,
LighthouseAuditMetricType,
} from '../types/LighthouseAuditType.ts';
import LighthouseUtils from './LighthouseUtils.ts';
} from '../auditors/types/LighthouseAuditType.ts';

describe('LighthouseUtils', () => {
it('should return true for "warning" or "error" status', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { describe, expect, it } from 'vitest';

import CodeComplexityConfig from '../auditors/code-complexity/CodeComplexityConfig.ts';
import {
CodeComplexityReportSummaryType,
HalsteadMetricType,
} from '../types/CodeComplexityAuditType.ts';
import CodeComplexityConfig from './CodeComplexityConfig.ts';
} from '../auditors/types/CodeComplexityAuditType.ts';

describe('CodeComplexityConfig', () => {
it('should format maintainability status correctly', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';

import CodeComplexityUtils from './CodeComplexityUtils.ts';
import CodeComplexityUtils from '../auditors/code-complexity/CodeComplexityUtils.ts';

describe('CodeComplexityUtils', () => {
const mockWorkspaceFolder = './src/auditors/code-complexity';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { auditStatus } from '@v6y/core-logic';
import Madge from 'madge';
import { describe, expect, it, vi } from 'vitest';

import { AuditCommonsType } from '../types/AuditCommonsType.ts';
import CodeCouplingUtils from './CodeCouplingUtils.ts';
import CodeCouplingUtils from '../auditors/code-coupling/CodeCouplingUtils.ts';
import { AuditCommonsType } from '../auditors/types/AuditCommonsType.ts';

// Mock external modules
vi.mock('madge', () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { AppLogger, auditStatus } from '@v6y/core-logic';
import { describe, expect, it, vi } from 'vitest';

import { CodeDuplicationAuditType } from '../types/CodeDuplicationAuditType.ts';
import CodeDuplicationUtils from './CodeDuplicationUtils.ts';
import CodeDuplicationUtils from '../auditors/code-duplication/CodeDuplicationUtils.ts';
import { CodeDuplicationAuditType } from '../auditors/types/CodeDuplicationAuditType.ts';

describe('CodeDuplicationUtils.formatCodeDuplicationReports', () => {
it('should return an empty array when duplicationFiles is empty or missing', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { AppLogger } from '@v6y/core-logic';
import { describe, expect, it, vi } from 'vitest';

import { CodeModularityAuditType, ProjectTree } from '../types/CodeModularityAuditType.ts';
import CodeModularityUtils from './CodeModularityUtils.ts';
import CodeModularityUtils from '../auditors/code-modularity/CodeModularityUtils.ts';
import { CodeModularityAuditType, ProjectTree } from '../auditors/types/CodeModularityAuditType.ts';

// Mock external modules
vi.mock('xml2js', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AuditUtils, auditStatus } from '@v6y/core-logic';
import { Mock, describe, expect, it, vi } from 'vitest';

import { AuditCommonsType } from '../types/AuditCommonsType.ts';
import CodeSecurityUtils from './CodeSecurityUtils.ts';
import CodeSecurityUtils from '../auditors/code-security/CodeSecurityUtils.ts';
import { AuditCommonsType } from '../auditors/types/AuditCommonsType.ts';

// Mock commons modules
vi.mock('@v6y/core-logic', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { AuditUtils, DeprecatedDependencyProvider, SemverUtils } from '@v6y/core-logic';
import { describe, expect, it, vi } from 'vitest';

import { AuditCommonsType } from '../types/AuditCommonsType.ts';
import DependenciesUtils from './DependenciesUtils.ts';
import DependenciesUtils from '../auditors/dependencies-auditor/DependenciesUtils.ts';
import { AuditCommonsType } from '../auditors/types/AuditCommonsType.ts';

// Mock commons modules
vi.mock('@v6y/core-logic', async () => {
Expand Down
Empty file.
Loading

0 comments on commit 322f3d5

Please sign in to comment.