Compare commits
2 Commits
f410b142c8
...
245169c01e
| Author | SHA1 | Date | |
|---|---|---|---|
|
245169c01e
|
|||
|
815187e544
|
@@ -1,9 +1,11 @@
|
||||
"""Pytest configuration for automatic typeguard integration."""
|
||||
|
||||
from typing import Any
|
||||
|
||||
from typeguard import install_import_hook
|
||||
|
||||
|
||||
def pytest_configure(config) -> None: # noqa: ARG001
|
||||
def pytest_configure(config: Any) -> None: # noqa: ARG001
|
||||
"""Configure pytest to use typeguard automatically."""
|
||||
# Install typeguard import hook to automatically check all functions
|
||||
# with type hints in the backend package during test runs
|
||||
@@ -15,7 +17,7 @@ def pytest_configure(config) -> None: # noqa: ARG001
|
||||
print("🛡️ Automatic typeguard hooks installed for test run")
|
||||
|
||||
|
||||
def pytest_runtest_setup(item):
|
||||
def pytest_runtest_setup(item: Any) -> None:
|
||||
"""Set up typeguard for each test run."""
|
||||
# The import hook is automatically enabled via pytest_configure
|
||||
# All functions with type hints will be automatically checked
|
||||
|
||||
@@ -12,6 +12,8 @@ export default defineConfig({
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}', 'tests/unit/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
||||
exclude: ['tests/e2e/**/*'],
|
||||
setupFiles: ['./src/test-setup.ts'], // Automatically install Zod validation hooks
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
|
||||
Reference in New Issue
Block a user