Commit e4a6834
committed
refactor: extract option helpers and add gh-pages integration tests
Extract option preparation helpers into dedicated module for better
separation of concerns and add comprehensive gh-pages integration tests.
**Refactoring:**
- Extract 6 helper functions from engine.ts to engine.prepare-options-helpers.ts:
- setupMonkeypatch(), mapNegatedBooleans(), handleUserCredentials()
- warnDeprecatedParameters(), appendCIMetadata(), injectTokenIntoRepoUrl()
- Create PreparedOptions type to replace verbose inline type definitions
- Move all 34 option helper tests to engine.prepare-options-helpers.spec.ts
- Reduce engine.ts from 439 to 244 lines (-44%)
**gh-pages Integration:**
- Add 30 new tests in engine.gh-pages-integration.spec.ts
- Verify exact arguments passed to gh-pages.publish() and gh-pages.clean()
- Implement options whitelist to filter internal options before passing to gh-pages
- Use module-level jest.mock() to avoid test file conflicts
- Mock Git class from gh-pages/lib/git to avoid spawning actual git processes
**Options Filtering:**
Internal options now filtered out before passing to gh-pages:
- dryRun, noDotfiles, noNotfound, noNojekyll (internal flags)
- notfound, nojekyll (used for file creation only)
- cname (used for CNAME file creation only)
- name, email (transformed to user object)
Only whitelisted options passed to gh-pages:
- repo, branch, message, remote, git, add, dotfiles, user
**Test Updates:**
- Update 7 builder-integration tests to verify filtered options
- All 315 tests passing
This ensures clean API contract with gh-pages and makes future
upgrades safer by explicitly controlling what gets passed through.1 parent ade5cff commit e4a6834
File tree
7 files changed
+950
-387
lines changed- .claude
- src
- engine
- parameter-tests
7 files changed
+950
-387
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
| |||
0 commit comments