Files
QuantEngineByItz/oms-wms-erp/tests/setup.ts
T
kjh2064 b34b0dd7d6
Validators (Pushes and Pull Requests) / UI & Storage Validation (pull_request) Failing after 12s
Validators (Pushes and Pull Requests) / Database & Schema Validation (pull_request) Successful in 13s
Validators (Pushes and Pull Requests) / Core Validators & Database Setup (pull_request) Failing after 28s
Validators (Pushes and Pull Requests) / WBS & Audit Validations (pull_request) Has been skipped
Validators (Pushes and Pull Requests) / .NET Contracts (pull_request) Has been skipped
Validators (Pushes and Pull Requests) / Calibration & Performance (pull_request) Has been skipped
Validators (Pushes and Pull Requests) / Operational Report & Decision Packet (pull_request) Has been skipped
Validators (Pushes and Pull Requests) / CI Workflow Lint (pull_request) Failing after 10s
Validators (Pushes and Pull Requests) / Security & Secrets (pull_request) Successful in 12s
Validators (Pushes and Pull Requests) / Notify PR Results (pull_request) Successful in 2s
Frontend CI Pipeline / ci-frontend-8-steps (pull_request) Failing after 2m50s
Add OMS WMS ERP platform
2026-07-27 00:45:39 +09:00

43 lines
946 B
TypeScript

/**
* Vitest Global Setup
* Initializes MSW server for all test suites
*/
import { beforeAll, afterEach, afterAll, vi } from 'vitest'
import { setupServer } from 'msw/node'
import { handlers } from './mocks/handlers'
/**
* MSW Server Instance
* Automatically intercepts HTTP requests during tests
*/
export const server = setupServer(...handlers)
/**
* Global Test Lifecycle Hooks
*/
// Enable request interception before all tests
beforeAll(() => {
server.listen({ onUnhandledRequest: 'warn' })
})
// Reset handlers after each test to ensure test isolation
afterEach(() => {
server.resetHandlers()
})
// Disable request interception after all tests
afterAll(() => {
server.close()
})
/**
* Mock console methods to reduce test output noise
* Remove these if debugging is needed
*/
beforeAll(() => {
// Optional: suppress console.warn for unhandled requests
// vi.spyOn(console, 'warn').mockImplementation(() => {})
})