A practical comparison of GitHub Copilot and ChatGPT for generating tests for React Native components, using the open-source Expensify app as a test subject. Both tools produce better results with human guidance and explicit context. Copilot works inline in the IDE but lacks project-wide context, while ChatGPT handles full component code pasted directly and generally produces more accurate initial results. Common pitfalls include hallucinated test IDs, incorrect mock assertions, and missing HOC mocks. The post also covers privacy concerns around sending code to third-party servers, and looks ahead at upcoming tools like GitHub TestPilot, Copilot X, and self-hosted LLMs.
Table of contents
GitHub CopilotGenerative Pre-Trained Transformers (known as GPT)More testsW hat will the future hold?PrivacySummarySort: