From 3a15c8080dbab079dfcb163246acec7ddb9a542e Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 17 Sep 2025 09:21:40 -0700 Subject: [PATCH] Update GitHub Copilot instructions with test details - Add comprehensive unit test examples with yarn test-unit - Include integration test examples with yarn test-integration - Document test filtering by file path and wildcard patterns - Explain test runner frameworks (mocha and playwright) --- .github/copilot-instructions.md | 42 +++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 38944ae8..99c70f1f 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -6,5 +6,43 @@ Please follow these guidelines when contributing: - Install dependencies: `npm install && npm run setup` - Build and bundle demo: `npm run build && npm run esbuild` -- Run unit tests: `npm run test-unit` -- Run playwright-based integration tests: `npm run test-integration` + +## Unit tests + +Unit tests are run with `yarn test-unit`: + +```sh +# 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`: + +```sh +# 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/`).