mirror of
https://github.com/xlorepdarkhelm/numinar-coding-project.git
synced 2026-09-08 23:33:12 -04:00
70 lines
1.6 KiB
Python
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)
|