Skip to content

Improve test failure handling#201

Open
millerds wants to merge 7 commits into
masterfrom
user/millerds/improve-test-failure-handling
Open

Improve test failure handling#201
millerds wants to merge 7 commits into
masterfrom
user/millerds/improve-test-failure-handling

Conversation

@millerds

Copy link
Copy Markdown
Contributor

Change Description:
Improve tests to handle more error cases and improve ts vs js seperation

  1. Do these changes impact any npm scripts commands (in package.json)? (e.g., running 'npm run start')
    No.

  2. Do these changes impact VS Code debugging options (launch.json)?
    No.

  3. Do these changes impact template output? (e.g., add/remove file, update file location, update file contents)
    No.

  4. 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 add jsconfig.json for JS/JSX editor tooling.
  • Switch Mocha execution/debugging to a repo-local ts-node registration 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.

Comment thread test/unit/word.test.ts
Comment thread test/unit/excel.test.ts
Comment thread test/end-to-end/src/host-tests.ts
Comment thread test/end-to-end/src/host-tests.ts Outdated
Comment thread test/end-to-end/src/test-helpers.ts Outdated
Comment thread test/end-to-end/src/test.index.tsx
Comment thread .npmrc Outdated
Comment thread package.json Outdated
Comment thread .vscode/launch.json
Comment thread .vscode/launch.json
millerds and others added 2 commits July 21, 2026 11:17
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Rick-Kirkham
Rick-Kirkham previously approved these changes Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants