This project uses Cypress for end-to-end testing.
Make sure dependencies are installed:
pnpm installTests require the development server to be running on port 8081. Start it before running any tests:
pnpm serveKeep this running and use a separate terminal for the test commands below.
Run all tests in headless mode:
pnpm testRun a specific test file:
pnpm test -- --spec "cypress/e2e/themes.cy.js"Open the Cypress Test Runner for interactive debugging:
pnpm cypressThis opens a browser where you can select and run individual tests.
Tests are located in cypress/e2e/:
| Test File | Description |
|---|---|
api.cy.js |
Tests for the AceDiff API methods |
basics.cy.js |
Basic initialization and rendering |
blank-lines.cy.js |
Handling of blank line diffs and merges |
diff-granularity.cy.js |
Broad vs specific diff granularity |
issue-93.cy.js |
Regression test for issue #93 |
left-to-right.cy.js |
Left-to-right merge operations |
merging.cy.js |
General merge functionality |
newlines.cy.js |
Handling of different EOL characters |
right-to-left.cy.js |
Right-to-left merge operations |
themes.cy.js |
Light and dark theme CSS verification |
HTML test fixtures are in test/fixtures/. Each fixture sets up an AceDiff instance with specific content for testing. You can view them directly at http://localhost:8081 when the server is running.