# 测试代码

了解可用于 GitHub Copilot 测试代码的方法。

## Links

* [生成单元测试](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/generate-unit-tests)

  副驾驶聊天 可帮助生成函数的单元测试。

* [创建模拟对象来使层抽象化](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/create-mock-objects)

  副驾驶聊天 可帮助创建模拟对象用于单元测试。

* [为网页创建端到端测试](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/create-end-to-end-tests)

  副驾驶聊天 可帮助生成端到端测试。

* [更新单元测试以匹配代码更改](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/update-unit-tests)

  副驾驶聊天 可帮助更新测试。