Skip to content

chore: exclude build artifacts from tsconfig and add legacy_createSto…#4844

Open
Divyapahuja31 wants to merge 2 commits intoreduxjs:masterfrom
Divyapahuja31:chore/fix-tests-and-config
Open

chore: exclude build artifacts from tsconfig and add legacy_createSto…#4844
Divyapahuja31 wants to merge 2 commits intoreduxjs:masterfrom
Divyapahuja31:chore/fix-tests-and-config

Conversation

@Divyapahuja31
Copy link

Description

This PR addresses two maintenance issues to improve repository health and developer experience:

  1. Added tests for legacy_createStore:

    • The legacy_createStore export was previously uncovered by tests, leaving a gap in coverage for createStore.ts.
    • I added test/legacy_createStore.spec.ts to verify the legacy alias functions correctly and exposes the same public API as createStore.
    • Result: This brings test coverage for createStore.ts to 100%.
  2. Updated tsconfig.json exclusions:

    • Previously, running yarn test (which triggers vitest --typecheck) would fail with hundreds of type errors if the website/, examples/, or coverage/ directories were present (e.g., after building the site or running coverage). This was because the root TypeScript config was attempting to check these directories which have their own unrelated configurations.
    • I added website, examples, docs, and coverage to the exclude list in tsconfig.json.
    • Result: yarn test now passes cleanly regardless of the state of these folders.
  3. Fixed missing dependency:

    • Detailed coverage reports were failing because @vitest/coverage-v8 was missing. I added it to devDependencies.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 6, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@markerikson
Copy link
Contributor

If we're going to do this, I'd rather have the existing createStore test file extended so that it runs all the same tests for both exports as a test.each()-style loop.

(tbh I also don't think we necessarily need tests for legacy_createStore :) it's a simple alias and re-export, and it's clearly worked fine for the last 4 years without anyone filing a bug against it.)

@aryaemami59
Copy link
Member

Agreed.

(tbh I also don't think we necessarily need tests for legacy_createStore :) it's a simple alias and re-export, and it's clearly worked fine for the last 4 years without anyone filing a bug against it.)

It's a simple alias/re-export, so dedicated tests don't seem necessary.

@Divyapahuja31
Copy link
Author

Thanks for the clarification, that makes sense. I agree that dedicated tests for legacy_createStore aren’t really needed since it’s just an alias and has been stable for a long time. I’ll remove the standalone test file and updated the PR accordingly.
Appreciate the guidance.

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