DEV Community

Shaily Shah
Shaily Shah

Posted on

Adding Tools to TIL Project.

I created a branch and wrote tests for core functionalities using Jest. From command line argument parsing to file processing, all thing worked fine.

Next, we delved into testing the txtToHtml module. We crafted tests for each function—textToHtml, markdownToHtml, generateSidebar, and generateIndexPage.

While doing this I did encountered some hurdle that I addressed unexpected logging by modifying functions to return values. File system operations challenges were mitigated by creating necessary directories and utilizing temporary ones. Deprecation warnings prompted updates and transitions to ensure future compatibility. Module not found errors were resolved by verifying module paths and dependencies. Each challenge presented a learning opportunity, enhancing our understanding of the codebase and bolstering the reliability of our tests.

Image description

Image description

In tackling unexpected logging issues, I refactored functions to return values instead of logging directly. For challenges with file system operations, I implemented directory creation and leveraged temporary directories for testing. Deprecation warnings led to updates and transitions to maintain future compatibility. Resolving module not found errors involved thorough verification of module paths and dependencies. Each hurdle was an opportunity for learning, fostering a deeper understanding of the codebase and strengthening the reliability of our tests.

Image description

Top comments (1)

Collapse
 
maame-codes profile image
Maame Afia Fordjour

Great piece!