test: add coaster name matching test suite
Extract matching logic into lib/coaster-match.ts (isCoasterMatch + normalizeForMatch) so it can be imported by both the scraper and tests without duplication. Add tests/coaster-matching.test.ts covering all known match/false-positive cases: - Trademark symbols, leading THE, possessives, punctuation - Subtitle variants in both directions (Apocalypse, New Revolution - Classic) - Space-split brand words (BAT GIRL vs Batgirl) - 4D subtitle extension (THE JOKER™ 4D Free Fly Coaster vs Joker) - False positives: Joker y Harley Quinn, conjunction connectors Run with: npm test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
"scrape": "tsx scripts/scrape.ts",
|
||||
"scrape:force": "tsx scripts/scrape.ts --rescrape",
|
||||
"discover": "tsx scripts/discover.ts",
|
||||
"debug": "tsx scripts/debug.ts"
|
||||
"debug": "tsx scripts/debug.ts",
|
||||
"test": "tsx --test tests/*.test.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"better-sqlite3": "^12.8.0",
|
||||
|
||||
Reference in New Issue
Block a user