Improve test failure handling#201
Open
millerds wants to merge 7 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the reliability of the test harness by adding clearer failure reporting/timeouts for end-to-end tests and reorganizing TypeScript vs JavaScript tooling/config to better isolate test-only TypeScript.
Changes:
- Add explicit timeout + “test-error” result handling to surface add-in initialization failures in E2E tests.
- Split TypeScript configuration for tests (
test/tsconfig.json) and addjsconfig.jsonfor JS/JSX editor tooling. - Switch Mocha execution/debugging to a repo-local
ts-noderegistration script and add a test typecheck script.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Replaces root TS config with a test-only config via extends/include. |
| test/unit/word.test.ts | Refactors Word mock typing for stricter TS checks. |
| test/unit/powerpoint.test.ts | Adds explicit mock types for PowerPoint unit tests. |
| test/unit/excel.test.ts | Refactors Excel mock context and callback typing. |
| test/tsconfig.json | Introduces strict TypeScript config scoped to tests. |
| test/register-ts-node.js | Adds a custom ts-node registration pointing at the test tsconfig. |
| test/end-to-end/ui-test.ts | Adds timeout + error-result handling when collecting E2E results. |
| test/end-to-end/src/test.index.tsx | Adds init error reporting to the taskpane test entrypoint. |
| test/end-to-end/src/test-helpers.ts | Adds structured test result helpers + richer error formatting. |
| test/end-to-end/src/host-tests.ts | Improves E2E host tests by awaiting Office.run calls and sending error results on failure. |
| package.json | Updates test scripts to use the custom ts-node register; adds typecheck:test. |
| jsconfig.json | Adds JS/JSX project config to distinguish JS vs TS projects. |
| convertToSingleHost.js | Ensures jsconfig.json is removed by the single-host conversion script. |
| .vscode/launch.json | Updates Mocha debug configs to use the custom ts-node register script. |
| .npmrc | Changes the npm registry to a Microsoft feed proxy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Rick-Kirkham
previously approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description:
Improve tests to handle more error cases and improve ts vs js seperation
Do these changes impact any npm scripts commands (in package.json)? (e.g., running 'npm run start')
No.
Do these changes impact VS Code debugging options (launch.json)?
No.
Do these changes impact template output? (e.g., add/remove file, update file location, update file contents)
No.
Do these changes impact documentation? (e.g., a tutorial on https://docs.microsoft.com/en-us/office/dev/add-ins/overview/office-add-ins)
No.
If you answered yes to any of these please do the following:
> Include 'Rick-Kirkham' in the review
> Make sure the README file is correct
Validation/testing performed:
Ran automated tests.