CraftJest / src /tools /setup_jest.py
firnnauriel's picture
Add Jest setup functionality and tabbed interface in UI
c83ce29
raw
history blame contribute delete
871 Bytes
import sys
import os
src_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(f"{src_path}/tools")
from utilities import read_markdown_file
def setup_jest() -> str:
"""
Automates the setup of Jest with TypeScript and code coverage in a new project.
Returns:
str: A comprehensive guide for Jest setup, including TypeScript
integration and code coverage configuration, generated by the AI.
Returns an error message string if an exception occurs.
"""
try:
output = read_markdown_file(f'{src_path}/prompts/setup_jest_sample_response_v2.md')
return output
except Exception as exc:
return f"Error during Jest setup: {exc}"
# For testing/debugging
if __name__ == "__main__":
print("Setting up Jest...")
output = setup_jest()
print("\n" + output)