test: enable typecheck for all spec files, not only types/* suites#5173
Open
rainerhahnekamp wants to merge 14 commits into
Open
test: enable typecheck for all spec files, not only types/* suites#5173rainerhahnekamp wants to merge 14 commits into
rainerhahnekamp wants to merge 14 commits into
Conversation
ffa818c to
c115594
Compare
Ensures Nx invalidates the test cache for all projects when the shared root vitest.config.mts changes. Closes #5172 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Projects that restrict test.include to a subfolder (effects, entity, schematics) now also restrict typecheck.include to the same pattern, so only files that are executed at runtime are also type-checked. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, schematics Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ec files - effects: cast MockInstance via unknown, fix Observable<string> effect return type, replace removed scheduler from RunHelpers with testScheduler - store: use MockInstance type for vi.spyOn results, replace fail() with throw - store-devtools: add non-null assertion on mock.lastCall - router-store: replace fail() with throw - component-store: add void type argument to Promise - signals: cast union DeepSignal to any, cast Signal<unknown> to WritableSignal - operators: fix vi.fn generic to match observable item type - eslint-plugin: add readonly to valid/invalid array return types Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… tests The type annotations on valid/invalid functions caused mismatches between the local Options type and the readonly tuple RuleTester.run() expects. Removing them lets TypeScript infer the return types directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…constraint RuleTester.run() expects readonly arrays; cast valid/invalid arrays at call sites to avoid the mutable-to-readonly assignability error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The rule test files (valid/invalid arrays) have a structural type incompatibility with RuleTester.run()'s readonly constraints that requires a broader refactor. Limit typecheck to spec/types/ for now and track the proper fix separately. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mergeConfig merges arrays so include alone isn't sufficient to scope typecheck; add an explicit exclude for spec/rules/ to prevent the base typecheck.include pattern from picking them up. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These files are excluded from typecheck so they should not have been modified as part of this PR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…bals Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8d92e85 to
09136eb
Compare
rainerhahnekamp
commented
Jul 2, 2026
Contributor
Author
|
@markostanimirovic, all tests except two signal tests pass. Since signals package is new and there are some issues with the types, could you please take a look? Not that we discovered two bugs or so... |
3 tasks
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.
Enable type-tests everywhere
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #5172
What is the new behavior?
Does this PR introduce a breaking change?