Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Repo Assist] Add TypeScript output support and snapshot update mode to integration tests#4495

Draft
github-actions[bot] wants to merge 1 commit into
main from
repo-assist/eng-typescript-integration-tests-4022-aeaa05e25412cc67
Draft

[Repo Assist] Add TypeScript output support and snapshot update mode to integration tests #4495
github-actions[bot] wants to merge 1 commit into
main from
repo-assist/eng-typescript-integration-tests-4022-aeaa05e25412cc67

Conversation

@github-actions

@github-actions github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.

Closes #4022


What

Extends the integration test framework with two improvements:

  1. TypeScript compilation pass — any test case directory that contains *.tsx.expected files will now also be compiled with --lang typescript and the output compared against those files. This makes it straightforward to add TypeScript-specific snapshot tests.

  2. Snapshot update mode — set UPDATE_SNAPSHOTS=true before running the integration tests and the runner will write actual output back to the *.expected files instead of asserting equality. This makes it easy to regenerate baselines after intentional output changes.

How

  • Refactored the compile-and-compare logic into a private compileAndCheck helper that accepts an extension (.jsx / .tsx), a glob pattern for expected files, and a list of extra CLI args. Each language's pass calls this helper in sequence.
  • Extended the normalize regex to strip version suffixes from both fable-library-js and fable-library-ts import paths (previously only fable-library-js was handled), so TypeScript expected files won't need updating on every library version bump.
  • Old *.actual scratch files are cleaned up before each test run, same as before.

Adding a TypeScript test

Drop one or more *.tsx.expected files next to the existing *.jsx.expected files in a test case directory (e.g., tests/Integration/Integration/data/xmlComment/). The integration runner will automatically pick them up and compile + compare against them.

To create the initial expected files, run once with:

UPDATE_SNAPSHOTS=true ./build.sh test integration

Trade-offs

  • The TypeScript compilation pass is skipped entirely when no *.tsx.expected files exist, so existing test cases have zero overhead.
  • No new dependencies introduced.

Checklist

  • Formatted with dotnet fantomas
  • Changelog updated (src/Fable.Cli/CHANGELOG.md)
  • CI validation (let CI run)

Note

🔒 Integrity filter blocked 70 items

The following items were blocked because they don't meet the GitHub integrity level.

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
 github:
 min-integrity: approved # merged | approved | unapproved | none

Generated by Repo Assist · くろまる 5.8M ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

...tests
- Integration tests now support TypeScript compilation alongside JavaScript.
 Add `*.tsx.expected` files in a test case directory to also validate
 TypeScript output; the runner calls Fable with `--lang typescript`.
- Refactor compile-and-check logic into a reusable `compileAndCheck` helper,
 keeping each language's pass self-contained.
- Extend the `normalize` regex to strip version numbers from both
 fable-library-js and fable-library-ts import paths.
- Support snapshot regeneration via the `UPDATE_SNAPSHOTS=true` environment
 variable: when set, actual output is written back to the `*.expected` files
 instead of compared, making it easy to update baselines after intentional
 output changes.
Addresses #4022
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

automation Automated changes enhancement repo-assist Created by Repo Assist TypeScript

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add support for TypeScript in the integration tests

0 participants

AltStyle によって変換されたページ (->オリジナル) /