Skip to content

Commit

Permalink
🚨(vitest) Abide by lint rule no-duplicate-type-constituents (#5764)
Browse files Browse the repository at this point in the history
**Description**

<!-- Please provide a short description and potentially linked issues
justifying the need for this PR -->

Related to #5282

<!-- * Your PR is fixing a bug or regression? Check for existing issues
related to this bug and link them -->
<!-- * Your PR is adding a new feature? Make sure there is a related
issue or discussion attached to it -->

<!-- You can provide any additional context to help into understanding
what's this PR is attempting to solve: reproduction of a bug, code
snippets... -->

**Checklist** — _Don't delete this checklist and make sure you do the
following before opening the PR_

- [x] The name of my PR follows [gitmoji](https://gitmoji.dev/)
specification
- [x] My PR references one of several related issues (if any)
- [x] New features or breaking changes must come with an associated
Issue or Discussion
- [x] My PR does not add any new dependency without an associated Issue
or Discussion
- [x] My PR includes bumps details, please run `pnpm run bump` and flag
the impacts properly
- [x] My PR adds relevant tests and they would have failed without my PR
(when applicable)

<!-- More about contributing at
https://github.com/dubzzz/fast-check/blob/main/CONTRIBUTING.md -->

**Advanced**

<!-- How to fill the advanced section is detailed below! -->

- [ ] Category: ...
- [ ] Impacts: ...

<!-- [Category] Please use one of the categories below, it will help us
into better understanding the urgency of the PR -->
<!-- * ✨ Introduce new features -->
<!-- * 📝 Add or update documentation -->
<!-- * ✅ Add or update tests -->
<!-- * 🐛 Fix a bug -->
<!-- * 🏷️ Add or update types -->
<!-- * ⚡️ Improve performance -->
<!-- * _Other(s):_ ... -->

<!-- [Impacts] Please provide a comma separated list of the potential
impacts that might be introduced by this change -->
<!-- * Generated values: Can your change impact any of the existing
generators in terms of generated values, if so which ones? when? -->
<!-- * Shrink values: Can your change impact any of the existing
generators in terms of shrink values, if so which ones? when? -->
<!-- * Performance: Can it require some typings changes on user side?
Please give more details -->
<!-- * Typings: Is there a potential performance impact? In which cases?
-->
  • Loading branch information
dubzzz authored Mar 1, 2025
1 parent 89a3419 commit 27a4e5a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-grapes-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fast-check/vitest": patch
---

🚨(vitest) Abide by lint rule `no-duplicate-type-constituents`
9 changes: 3 additions & 6 deletions packages/vitest/src/internals/TestBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,15 @@ function adaptRunDetailsForRecord<Ts>(
* @param testFn - The source `{it,test}.*`
*/
function buildTestProp<Ts extends [any] | any[], TsParameters extends Ts = Ts>(
// eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents
testFn: It | It['only' | 'skip' | 'concurrent'] | It['concurrent']['only' | 'skip'],
testFn: It | It['only' | 'skip' | 'concurrent'],
fc: FcExtra,
): TestPropTuple<Ts, TsParameters>;
function buildTestProp<Ts, TsParameters extends Ts = Ts>(
// eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents
testFn: It | It['only' | 'skip' | 'concurrent'] | It['concurrent']['only' | 'skip'],
testFn: It | It['only' | 'skip' | 'concurrent'],
fc: FcExtra,
): TestPropRecord<Ts, TsParameters>;
function buildTestProp<Ts extends [any] | any[], TsParameters extends Ts = Ts>(
// eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents
testFn: It | It['only' | 'skip' | 'concurrent'] | It['concurrent']['only' | 'skip'],
testFn: It | It['only' | 'skip' | 'concurrent'],
fc: FcExtra,
): TestPropTuple<Ts, TsParameters> | TestPropRecord<Ts, TsParameters> {
return (arbitraries, params?: FcParameters<TsParameters>) => {
Expand Down
3 changes: 1 addition & 2 deletions packages/vitest/src/internals/TestWithPropRunnerBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ function wrapProp<Ts extends [any] | any[]>(prop: Prop<Ts>): PromiseProp<Ts> {
}

export function buildTestWithPropRunner<Ts extends [any] | any[], TsParameters extends Ts = Ts>(
// eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents
testFn: It | It['only' | 'skip' | 'concurrent'] | It['concurrent']['only' | 'skip'],
testFn: It | It['only' | 'skip' | 'concurrent'],
label: string,
arbitraries: ArbitraryTuple<Ts>,
prop: Prop<Ts>,
Expand Down

0 comments on commit 27a4e5a

Please sign in to comment.