Add: tests and refactoring#1
Open
Rahmon wants to merge 16 commits into
Open
Conversation
Install Jest ^29, wire up test scripts in package.json, create jest.config.js, add coverage/ to .gitignore, bump CI to Node 26 with npm test step, and add 16 passing unit tests for src/helpers.js (unleadingslashit, untrailingslashit, removeEndSlashes). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 tests covering validateNotEmpty, validateBool, parseHostname, and parseProxyUrl in the 10up lint-clean style; 43/43 passing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
13 tests covering slugify behavior and proxy URL construction (http prefix, .com TLD replacement, no-dot case). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tests getConfigDirectory, getGlobalDirectory, getDefaults (path composition under a mocked os.homedir), and createProxyConfig (placeholder substitution, multi-placeholder, and passthrough cases). 68/68 tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
21 tests covering marshalDomains (dedup, extraHosts, scalar/array), marshalWordPress (boolean expansion, type, purify, field mapping), and top-level field passthrough (php, name, elasticsearch, mediaProxy). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 tests covering PHP image selection, certs/CERT_NAME, VIRTUAL_HOST wildcards, wordpress dev/non-dev nginx+wp-cli config, elasticsearch on/off, Linux vs non-Linux branch (custom image, build args, volumes), cacheVolume presence, dockerCompose filter hook, spinner calls, and a full-config snapshot. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 tests covering all 8 proxied methods (arg forwarding, exitCode error throwing) and isRunning (port resolve→true, port reject→false). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers start/stop/restart/deleteEnv orchestration and all *All iteration functions. Verifies call ordering (down before upAll on restart), the confirm=false short-circuit in deleteEnv, sudo host removal path, and spinner.warn on sudo error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Run lint-staged (eslint --fix) for lint+format and the unit test suite on every commit. Integration tests are excluded to keep commits fast. Migrate husky from v4 to v9 using the .husky/ directory and core.hooksPath. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add prettier and eslint-config-prettier, with .prettierrc.json (tabs, single quotes, 100 print width; 2-space override for YAML) and .prettierignore. Hand formatting to Prettier and keep ESLint for code quality only (extend "prettier" to disable conflicting rules). Switch the format script to "prettier --write", add a "format:check" script, and run both eslint --fix and prettier --write via lint-staged. Reformat the existing codebase accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the push-on-everything Node CI with a workflow triggered by pushes and pull requests targeting develop or main. It installs deps, runs ESLint, prettier --check, and the full test suite across Node 20, 22 and 26. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Align the pinned dev Node version with the local environment and the CI matrix (was 18, which also conflicted with engines >=20). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove the 10up-authored ESLint shareable config and its babel-eslint parser. Extend eslint:recommended directly (with explicit parserOptions/env so the default espree parser is used) and inline the worthwhile code-quality rules the 10up config provided (prefer-const, prefer-template, no-var, no-alert). Prettier continues to own formatting via eslint-config-prettier. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
No description provided.