Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat(rule-tester): portcheckDuplicateTestCases
from ESLint#9026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
JoshuaKGoldberg merged 27 commits intotypescript-eslint:mainfromabrahamguo:duplicate-test-casesJun 1, 2024
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
27 commits Select commitHold shift + click to select a range
620416d
port checkDuplicate from ESLint
abrahamguo72faa0d
lint
abrahamguo2870725
revert lib change
abrahamguoc0da154
move serialization to utils
abrahamguo4cab72b
add issuenum for Object.hasOwn
abrahamguo9cacae9
Merge branch 'main' of github.com:abrahamguo/typescript-eslint into d…
abrahamguob4e0d87
test cases for duplication
abrahamguoc31e1be
dedupe some bulk tests
abrahamguo1f1a290
Merge branch 'main' of github.com:abrahamguo/typescript-eslint into d…
abrahamguoc2db7bd
dedupe naming-convention
abrahamguo646aa94
make utility
abrahamguo0a02368
prefer-nullish-coalescing
abrahamguo618307d
prefer-readonly-parameter-types
abrahamguo88efa1b
member-ordering
abrahamguo3e8231d
sort
abrahamguofcae2d0
consistent-type-assertion
abrahamguodd112cf
add comment
abrahamguo73c7a9d
cleanup
abrahamguoddd20bb
fix formatting
abrahamguoac89ac3
add explanation
abrahamguo146ae8f
func-call-spacing
abrahamguob9617b5
Merge branch 'main' of github.com:abrahamguo/typescript-eslint into d…
abrahamguoba8c6cc
remove naming-convention
abrahamguo6693ea3
remove debugging
abrahamguo4fe40ce
Merge branch 'main' of github.com:abrahamguo/typescript-eslint into d…
abrahamguod136b04
Merge branch 'main' of github.com:abrahamguo/typescript-eslint into d…
abrahamguo3cf2411
change quotes
abrahamguoFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
14 changes: 14 additions & 0 deletionspackages/eslint-plugin/tests/dedupeTestCases.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const dedupeTestCases = <T>(...caseArrays: (readonly T[])[]): T[] => { | ||
const cases = caseArrays.flat(); | ||
const dedupedCases = Object.values( | ||
Object.fromEntries( | ||
cases.map(testCase => [JSON.stringify(testCase), testCase]), | ||
), | ||
); | ||
if (cases.length === dedupedCases.length) { | ||
throw new Error( | ||
'`dedupeTestCases` is not necessary — no duplicate test cases detected!', | ||
); | ||
} | ||
return dedupedCases; | ||
}; |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.