Answer: Save the prompt content as generate-unit-tests.prompt.md in your .github/prompts folder, open the code file with the function(s) you want tests for, then in Visual Studio Code display the Copilot Chat view and enter /generate-unit-tests. You can optionally highlight a specific function and specify the target function and testing framework, for example function_name=fetchActivities and framework=pytest. Status: Confirmed Entry: tool/github-copilot/features/use-unit-test-prompt-file Revision: 2 Digest: sha256:9e883279ecf7858d (changes whenever the content changes) Timeline: Created: 2026-11-13T03:34:14Z Last changed: 2026-11-19T13:10:13Z (chat command: — → /generate-unit-tests) Last verified: 2026-11-20T13:16:33Z Next check: 2026-11-21T13:16:33Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of prompt file name | generate-unit-tests.prompt.md | [1] | 2026-11-20 prompt folder | .github/prompts | [1] | 2026-11-20 chat command | /generate-unit-tests | [1] | 2026-11-20 example function parameter | function_name=fetchActivities | [1] | 2026-11-20 example framework parameter | framework=pytest | [1] | 2026-11-20 Sources: [1] GitHub. "Generate unit tests - GitHub Docs". https://docs.github.com/en/copilot/tutorials/customization-library/prompt-files/generate-unit-tests Role: primary. Accessed: 2026-11-20T13:16:33Z Quote: "Save the above content as generate-unit-tests.prompt.md in your .github/prompts folder." (Supports: prompt file name, prompt folder) Quote: "display the Copilot Chat view and enter /generate-unit-tests ." (Supports: chat command) Quote: "you can also specify the target function and testing framework by typing function_name=fetchActivities and framework=pytest" (Supports: example function parameter, example framework parameter) Snapshot SHA-256: 3fe9d2cdebad63a909dd87c84841b8a14e62c7eb5ac697355fb843bd0493ab6a (captured 2026-11-18T13:13:15Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:13:14Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:16:33Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:16:33Z Last attempt: 2026-11-20T13:16:33Z Notes and limitations: Extracted automatically from a single official source (section "How to use this prompt file"). Related: https://latestn.com/tool/github-copilot/features/useful-research-results How can I get useful research results from GitHub Copilot agents? https://latestn.com/tool/github-copilot/features/verify-context-and-intent-prompts What example prompts can I use to verify context and intent in GitHub Copilot-generated code? https://latestn.com/tool/github-copilot/features/view-code-references-copilot-chat How do I view code references for GitHub Copilot Chat suggestions? https://latestn.com/tool/github-copilot/features/use-local-sandboxing How do I use local sandboxing with GitHub Copilot? https://latestn.com/tool/github-copilot/features/use-onboarding-plan-prompt-file How do I use the GitHub Copilot onboarding plan prompt file? https://latestn.com/tool/github-copilot/features/use-readme-generator-prompt How do I use the README generator prompt file in GitHub Copilot? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T13:10:13Z | changed | chat command: — → /generate-unit-tests | [1] 2026-11-19T13:10:13Z | changed | prompt folder: — → .github/prompts | [1] 2026-11-19T13:10:13Z | changed | prompt file name: — → generate-unit-tests.prompt.md | [1] 2026-11-19T13:10:13Z | changed | command: /generate-unit-tests → — | [1] 2026-11-19T13:10:13Z | changed | folder: .github/prompts → — | [1] 2026-11-19T13:10:13Z | changed | file name: generate-unit-tests.prompt.md → — | [1] 2026-11-13T03:34:14Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/features/use-unit-test-prompt-file/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/github-copilot/features/use-unit-test-prompt-file POST: https://latestn.com/dispute/tool/github-copilot/features/use-unit-test-prompt-file with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/features/use-unit-test-prompt-file?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I use the GitHub Copilot unit test generation prompt file? Revision 2, last verified 2026-11-20T13:16:33Z. https://latestn.com/tool/github-copilot/features/use-unit-test-prompt-file (accessed 2026-11-21T09:54:48Z). @misc{LatestN_tool_github_copilot_features_use_unit_test_prompt_file_r2, title = {How do I use the GitHub Copilot unit test generation prompt file?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/features/use-unit-test-prompt-file}}, note = {Revision 2; digest sha256:9e883279ecf7858d; last verified 2026-11-20T13:16:33Z; accessed 2026-11-21T09:54:48Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/github-copilot/features/use-unit-test-prompt-file