Skip to content

Add comprehensive tests for tsconfig extends functionality#660

Merged
Boshen merged 2 commits intomainfrom
copilot/fix-b2e756c2-5f7f-48fd-b2c7-b4e2bb5fb353
Aug 24, 2025
Merged

Add comprehensive tests for tsconfig extends functionality#660
Boshen merged 2 commits intomainfrom
copilot/fix-b2e756c2-5f7f-48fd-b2c7-b4e2bb5fb353

Conversation

Copy link
Contributor

Copilot AI commented Aug 24, 2025

This PR adds comprehensive test coverage for the extend_tsconfig method in src/tsconfig.rs which handles inheritance of TypeScript configuration settings when using the extends field.

The new test suite includes:

  • Base URL inheritance: Tests that baseUrl is properly inherited from parent configs
  • Paths inheritance: Validates that path aliases are inherited and resolved correctly
  • Override behavior: Ensures child configurations override parent values when present
  • JSX options: Tests inheritance of JSX-related compiler options
  • Template variables: Validates ${configDir} template variable handling with extends
  • Multiple inheritance chains: Tests inheritance through multiple levels of extends
  • Child setting preservation: Ensures existing child settings are not overridden
  • Direct method testing: Unit tests for the extend_tsconfig method logic

All tests include corresponding fixture files that mirror real-world TypeScript configuration scenarios. This ensures the resolver correctly handles complex tsconfig inheritance patterns used in modern TypeScript projects.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@graphite-app
Copy link

graphite-app bot commented Aug 24, 2025

How to use the Graphite Merge Queue

Add the label merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@Boshen
Copy link
Member

Boshen commented Aug 24, 2025

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 24, 2025

@copilot learn

I've learned from the existing test patterns and created comprehensive tests for the extend_tsconfig method. I added a new test module tsconfig_extends.rs with 8 test cases covering:

  • Base URL inheritance
  • Paths inheritance with aliases
  • Override behavior (child overrides parent)
  • JSX options inheritance
  • Template variable handling
  • Multiple inheritance chains
  • Preservation of child settings
  • Direct testing of extend_tsconfig logic

All tests include corresponding fixture files and pass successfully. The implementation validates that the extend_tsconfig method properly inherits settings while preserving child configurations. Commit: 022f04d

Copilot AI changed the title [WIP] Learn how test setups for tsconfig in Add comprehensive tests for tsconfig extends functionality Aug 24, 2025
@codecov
Copy link

codecov bot commented Aug 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.02%. Comparing base (7072414) to head (022f04d).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #660      +/-   ##
==========================================
+ Coverage   94.95%   95.02%   +0.07%     
==========================================
  Files          12       12              
  Lines        2816     2816              
==========================================
+ Hits         2674     2676       +2     
+ Misses        142      140       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Boshen Boshen marked this pull request as ready for review August 24, 2025 14:51
@Boshen Boshen merged commit 177a8f5 into main Aug 24, 2025
15 checks passed
@Boshen Boshen deleted the copilot/fix-b2e756c2-5f7f-48fd-b2c7-b4e2bb5fb353 branch August 24, 2025 14:51
@oxc-bot oxc-bot mentioned this pull request Aug 24, 2025
Boshen added a commit that referenced this pull request Aug 25, 2025
## 🤖 New release

* `oxc_resolver`: 11.6.2 -> 11.7.0
* `oxc_resolver_napi`: 11.6.2 -> 11.7.0

<details><summary><i><b>Changelog</b></i></summary><p>

## `oxc_resolver`

<blockquote>

##
[11.7.0](v11.6.2...v11.7.0)
- 2025-08-25

### <!-- 0 -->🚀 Features

- *(tsconfig)* support `files` / `include` / `exclude`
([#659](#659)) (by
@shulaoda)
- feat(tsconfig) support `allowJs` in `compilerOptions`
([#658](#658)) (by
@shulaoda) - #658
- *(tsconfig)* complete inheritance of `compilerOptions` fields
([#657](#657)) (by
@shulaoda)

### <!-- 1 -->🐛 Bug Fixes

- *(tsconfig)* respect Yarn PnP when resolving `extends` paths
([#656](#656)) (by
@shulaoda)

### <!-- 6 -->🧪 Testing

- *(tsconfig)* tweak jsx `extends` tests
([#666](#666)) (by
@shulaoda)

### <!-- 9 -->💼 Other

- Add comprehensive tests for tsconfig extends functionality
([#660](#660)) (by
@Copilot) - #660

### Contributors

* @shulaoda
* @renovate[bot]
* @Copilot
</blockquote>



</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

---------

Co-authored-by: Boshen <boshenc@gmail.com>
@oxc-bot oxc-bot mentioned this pull request Aug 25, 2025
@oxc-bot oxc-bot mentioned this pull request Sep 7, 2025
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.

2 participants