Files
conference-room-booking-system/frontend/noxfile.py
2025-09-20 22:12:06 -04:00

70 lines
1.6 KiB
Python

"""Nox sessions for frontend tasks.
Run with `nox -s <session>` from the project root or frontend directory.
"""
import os
from pathlib import Path
import nox
@nox.session(name="typecheck")
def typecheck(session: nox.Session) -> None:
"""Run TypeScript type checks.
Args:
session: The Nox session object.
"""
frontend_dir = Path(__file__).parent
os.chdir(frontend_dir)
session.run("yarn", "tsc", "--noEmit", external=True)
@nox.session(name="coverage")
def coverage(session: nox.Session) -> None:
"""Run Jest with coverage reporting.
Args:
session: The Nox session object.
"""
frontend_dir = Path(__file__).parent
os.chdir(frontend_dir)
session.run("yarn", "jest", "--coverage", external=True)
@nox.session(name="audit")
def audit(session: nox.Session) -> None:
"""Run yarn audit for security checks.
Args:
session: The Nox session object.
"""
frontend_dir = Path(__file__).parent
os.chdir(frontend_dir)
session.run("yarn", "audit", external=True)
@nox.session(name="storybook")
def storybook(session: nox.Session) -> None:
"""Run Storybook for frontend documentation.
Args:
session: The Nox session object.
"""
frontend_dir = Path(__file__).parent
os.chdir(frontend_dir)
session.run("yarn", "storybook", external=True)
@nox.session(name="jest")
def jest(session: nox.Session) -> None:
"""Run frontend Jest tests using yarn.
Args:
session: The Nox session object.
"""
frontend_dir = Path(__file__).parent
os.chdir(frontend_dir)
session.run("yarn", "run", "jest", external=True)