Skip to content

Commit 01614ee

Browse files
Enhance unit tests by adding beforeAll hook and importing vi from Vitest
- Updated auth and project validator tests to include the beforeAll hook for improved test setup. - Added import of vi in the config fixture to facilitate mocking capabilities. These changes improve the structure and functionality of the testing framework.
1 parent 4ce0b07 commit 01614ee

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

api/tests/unit/validators/auth.validator.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect } from 'vitest';
1+
import { describe, it, expect, beforeAll } from 'vitest';
22
import { checkSchema, validationResult } from 'express-validator';
33

44
const mockReq = (body: any) => ({

api/tests/unit/validators/project.validator.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect } from 'vitest';
1+
import { describe, it, expect, beforeAll } from 'vitest';
22
import { validationResult } from 'express-validator';
33

44
const mockReq = (body: any) => ({

upload-api/tests/fixtures/config.fixture.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { vi } from 'vitest';
2+
13
export const createMockConfig = (overrides: Record<string, any> = {}) => ({
24
plan: { dropdown: { optionLimit: 100 } },
35
cmsType: 'wordpress',

0 commit comments

Comments
 (0)