Files
xterm.js/.github/copilot-instructions.md
T
Daniel Imms 398e87490d Add coding guidelines and lint-fix script
- Add coding guidelines section to copilot instructions
- Specify rule about avoiding comments in unit tests
- Add lint-fix npm script for auto-fixing ESLint issues
2025-09-18 13:27:12 -07:00

1.5 KiB

This is a TypeScript-based repository with a Ruby client for certain API endpoints. It includes several sub projects called addons which are built separately. It contains a demo application which showcases the functionality of the project.

Please follow these guidelines when contributing:

Development Flow

  • Install dependencies: npm install && npm run setup
  • Build and bundle demo: npm run build && npm run esbuild

Coding guidelines

  • Do not write comments in unit tests unless the test is particularly complex. When they are complex, add the descriptions into the assertion calls where possible.

Unit tests

Unit tests are run with yarn test-unit:

# All unit tests
yarn test-unit

# Absolute file path
yarn test-unit out-esbuild/browser/Terminal.test.js

# Filter by wildcard
yarn test-unit out-esbuild/**/Terminal.test.js

# Specific addon unit tests tests
yarn test-unit addons/addon-image/out-esbuild/*.test.js

# Multiple files
yarn test-unit out-esbuild/**/Terminal.test.js out-esbuild/**/InputHandler.test.js

These use mocha to run all .test.js files within the esbuild output (out-esbuild/).

Integration tests

Integration tests are run with yarn test-integration:

# All integration tests
yarn test-integration

# Core integration tests
yarn test-integration --suite=core

# Specific addon integration tests
yarn test-integration --suite=addon-search

These use @playwright/test to run all tests within the esbuild test output (out-esbuild-test/).