laiso / site2pdf

Generate comprehensive PDFs of entire websites, ideal for RAG.
MIT License
176 stars 8 forks source link

test: Add CLI Integration Test and Related Directory Structure Changes #10

Closed laiso closed 4 months ago

laiso commented 4 months ago

Overview:

https://github.com/laiso/site2pdf/blob/d296bc01daf03e64831a18673b296931b5733299/tests/cli.test.ts#L4-L18

  1. CLI File Path Update:

    • Changed the npx command in bin/site2pdf.js from ../index.ts to ../src/index.ts.
  2. Jest Configuration Update:

    • Added moduleNameMapper to jest.config.js to map the site2pdf/* path to <rootDir>/src/$1.
  3. Added Test Files and Fixtures:

    • Added cli.test.ts to implement CLI integration tests.
    • Added a test HTML file (index.html) to tests/fixtures.
    • Moved the test PDF file (sample.pdf) to tests/fixtures.
  4. Directory Structure Changes:

    • Renamed index.ts to src/index.ts.
    • Moved other test files to the tests directory.

These changes add CLI integration tests and reorganize the project's directory structure.