Skip to content

Conversation

@stefan-burke
Copy link
Member

No description provided.

claude and others added 15 commits January 6, 2026 23:58
- Add expectNoStaleExceptions helper to code-scanner.js for DRY stale validation
- Update null-checks, let-usage, object-mutation tests to use new helper
- Refactor config.test.js to verify DEFAULTS keys instead of duplicating values
- Extract shared .quote-checkout-summary/.hire-dates-section styles to style.scss

Reduces clone count from 21 to 16 at 45-token threshold.
- quote-steps: Data-driven updateButtons tests + setupQuoteStepsNav helper
- unused-images: expectLogContains/expectAllImagesUsed curried assertions
- guides: guide() factory function for test data creation

Reduces clone count from 16 to 7 at 45-token threshold.
- Extract expectLogContains to test-utils.js for reuse
- Add guides() helper using map for cleaner test data creation
Add getToday(), createHireDatesHtml(), withHireTestSetup(), and
initHireWithCallback() helpers to reduce test duplication. Eliminates
repeated date calculations and DOM setup code across multiple tests.
Refactor addFile and addMarkdown tests to use existing withTestSite
helper instead of manual try/finally cleanup. Extract common page
config to minimalPage() factory function.
Add typeSizeData() factory for common type/size filter configuration.
Add categorizedProducts() factory for products with category setups.
Reduces test duplication by reusing shared fixtures.
Add runEleventyAfter() helper in unused-images tests to share the
config/handler/logging setup. Add lunchMenuWithItem() factory in
pdf tests for dietary key test cases. Eliminates remaining jscpd
clones at minTokens=45.
- Replace forEach with for...of in quote-steps data-driven tests
- Inline createHireDatesHtml into withHireTestSetup
- Update test-hygiene allowlist with new test helpers
- Fix stale line numbers in code-quality-exceptions
The curried expectLogContains helper was overengineered for a single
use case. Replace with a simple inline assertion in the test file.
Test that stale exception entries are logged before the assertion fails.
Uses expect().toThrow() to avoid needing a try/catch block.
@stefan-burke stefan-burke merged commit 55360d9 into main Jan 7, 2026
7 checks passed
@stefan-burke stefan-burke deleted the claude/reduce-jscpd-tokens-6DclR branch January 7, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants