test(M14): tests unitaires useMarketplace, clanSystem et couverture de code - #382
Merged
Merged
Conversation
…couverture de code - Crée src/test/useMarketplace.test.ts : 19 tests pour useListings, useMyListings, useCreateListing, useBuyHero, useCancelListing avec mock Supabase et QueryClientProvider - Crée src/test/clanSystem.test.ts : 17 tests pour getActiveClanSkills et getClanAffinityMultiplier (familles, fallback HERO_VISUALS, clans multiples) - Configure la couverture Istanbul/c8 dans vitest.config.ts (provider v8, reporters text/html/json-summary) - Ajoute le script test:coverage dans package.json - Installe @vitest/coverage-v8 et @testing-library/react en devDependencies Closes #370, #372, #373 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Mar 22, 2026
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.
Summary
src/test/useMarketplace.test.ts: 19 tests pour les 5 hooks du marketplace (useListings,useMyListings,useCreateListing,useBuyHero,useCancelListing) avec mock Supabase etQueryClientProvidersrc/test/clanSystem.test.ts: 17 tests pourgetActiveClanSkillsetgetClanAffinityMultiplier(tableau vide, mono-clan, multi-clans, fallbackHERO_VISUALS, affinités ennemis)vitest.config.ts(provider v8, reporterstext,html,json-summary, scopesrc/game/**+src/hooks/**)test:coveragedanspackage.json@vitest/coverage-v8et@testing-library/reacten devDependenciesTest plan
npm run test: 223 tests passent (202 existants + 21 nouveaux)useMarketplace.test.ts: cas nominaux, cas d'erreur Supabase, RPCsuccess: false, filtrage rareté, tri prixclanSystem.test.ts: tableau vide, héros sans famille, fallback icône, 2 héros même clan, clans multiples, tous les clans principaux dans CLAN_ENEMY_AFFINITYnpm run test:coveragedisponible pour générer le rapport de couvertureCloses #370, #372, #373
🤖 Generated with Claude Code