Skip to content

Commit 556b75e

Browse files
authored
♻️ Finish CLI audit cleanup stack
Why: land the remaining CLI audit stack as the final integration PR after preserving the smaller review units.\n\nWhat changed:\n- Integrated server events, uploader boundaries, TDD/status plumbing, Storybook client cleanup, and static-site client cleanup.\n- Removed stale compatibility paths and dead runtime/service code.\n- Added focused outcome coverage around commands, server routes, uploader behavior, and client packages.\n\nVerification:\n- npm run lint\n- npm run build\n- GitHub CI Status passed on PR #265
1 parent 444f567 commit 556b75e

88 files changed

Lines changed: 4778 additions & 2525 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

clients/ember/bin/vizzly-testem-launcher.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ async function main() {
103103

104104
// 2. Determine failOnDiff: env var > server.json > default (false)
105105
let failOnDiff = false;
106-
if (process.env.VIZZLY_FAIL_ON_DIFF === 'true' || process.env.VIZZLY_FAIL_ON_DIFF === '1') {
106+
if (
107+
process.env.VIZZLY_FAIL_ON_DIFF === 'true' ||
108+
process.env.VIZZLY_FAIL_ON_DIFF === '1'
109+
) {
107110
failOnDiff = true;
108111
} else {
109112
let serverInfo = getServerInfo();

clients/ember/src/launcher/screenshot-server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ function httpPost(url, data) {
181181

182182
if (res.statusCode >= 400) {
183183
reject(
184-
new Error(`Vizzly server error: ${res.statusCode} - ${responseBody}`)
184+
new Error(
185+
`Vizzly server error: ${res.statusCode} - ${responseBody}`
186+
)
185187
);
186188
return;
187189
}

clients/ember/src/test-support/index.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ function prepareTestingContainer(width = 1280, height = 720, fullPage = false) {
161161
* @returns {boolean}
162162
*/
163163
function shouldFailOnDiff() {
164-
return window.__VIZZLY_FAIL_ON_DIFF__ === true ||
165-
window.__VIZZLY_FAIL_ON_DIFF__ === 'true';
164+
return (
165+
window.__VIZZLY_FAIL_ON_DIFF__ === true ||
166+
window.__VIZZLY_FAIL_ON_DIFF__ === 'true'
167+
);
166168
}
167169

168170
/**
@@ -285,7 +287,9 @@ export async function vizzlyScreenshot(name, options = {}) {
285287
// Check if this is a "no server" error - gracefully skip instead of failing
286288
// This allows tests to pass when Vizzly isn't running (like Percy behavior)
287289
if (errorText.includes('No Vizzly server found')) {
288-
console.warn('[vizzly] Vizzly server not running. Skipping visual screenshot.');
290+
console.warn(
291+
'[vizzly] Vizzly server not running. Skipping visual screenshot.'
292+
);
289293
return { status: 'skipped', reason: 'no-server' };
290294
}
291295

@@ -302,12 +306,14 @@ export async function vizzlyScreenshot(name, options = {}) {
302306
if (shouldFail) {
303307
throw new VizzlyDiffError(
304308
`Visual difference detected for '${name}' (${result.diffPercentage?.toFixed(2)}% diff). ` +
305-
`View diff in Vizzly dashboard.`
309+
`View diff in Vizzly dashboard.`
306310
);
307311
}
308312

309313
// Log warning but don't fail
310-
console.warn(`[vizzly] Visual difference detected for '${name}'. View diff in Vizzly dashboard.`);
314+
console.warn(
315+
`[vizzly] Visual difference detected for '${name}'. View diff in Vizzly dashboard.`
316+
);
311317
}
312318

313319
return result;
@@ -320,7 +326,9 @@ export async function vizzlyScreenshot(name, options = {}) {
320326
// Log connection errors only once to avoid spam
321327
if (!hasLoggedConnectionError) {
322328
hasLoggedConnectionError = true;
323-
console.warn(`[vizzly] Screenshots skipped - server not available. Run 'vizzly tdd start' to enable.`);
329+
console.warn(
330+
`[vizzly] Screenshots skipped - server not available. Run 'vizzly tdd start' to enable.`
331+
);
324332
}
325333
return { status: 'skipped', reason: 'error', error: error.message };
326334
} finally {

clients/ember/tests/unit/screenshot-server.test.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,10 @@ describe('screenshot-server', () => {
231231
// (unless there's a server.json in a parent directory)
232232
if (info !== null) {
233233
assert.ok(typeof info.url === 'string', 'should have url');
234-
assert.ok(typeof info.failOnDiff === 'boolean', 'should have failOnDiff');
234+
assert.ok(
235+
typeof info.failOnDiff === 'boolean',
236+
'should have failOnDiff'
237+
);
235238
}
236239
} finally {
237240
process.chdir(originalCwd);
@@ -260,8 +263,16 @@ describe('screenshot-server', () => {
260263
let info = getServerInfo();
261264

262265
assert.ok(info !== null, 'should find server.json');
263-
assert.strictEqual(info.url, 'http://localhost:47392', 'should have correct url');
264-
assert.strictEqual(info.failOnDiff, true, 'should read failOnDiff as true');
266+
assert.strictEqual(
267+
info.url,
268+
'http://localhost:47392',
269+
'should have correct url'
270+
);
271+
assert.strictEqual(
272+
info.failOnDiff,
273+
true,
274+
'should read failOnDiff as true'
275+
);
265276
} finally {
266277
process.chdir(originalCwd);
267278
}
@@ -287,8 +298,16 @@ describe('screenshot-server', () => {
287298
let info = getServerInfo();
288299

289300
assert.ok(info !== null, 'should find server.json');
290-
assert.strictEqual(info.url, 'http://localhost:47393', 'should have correct url');
291-
assert.strictEqual(info.failOnDiff, false, 'should default failOnDiff to false');
301+
assert.strictEqual(
302+
info.url,
303+
'http://localhost:47393',
304+
'should have correct url'
305+
);
306+
assert.strictEqual(
307+
info.failOnDiff,
308+
false,
309+
'should default failOnDiff to false'
310+
);
292311
} finally {
293312
process.chdir(originalCwd);
294313
}

clients/ember/tests/unit/testem-config.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ describe('testem-config', () => {
155155

156156
configure({}, {});
157157

158-
assert.ok(!existsSync(configPath), 'should not write empty playwright.json');
158+
assert.ok(
159+
!existsSync(configPath),
160+
'should not write empty playwright.json'
161+
);
159162
});
160163

161164
it('handles lowercase browser names', () => {

clients/static-site/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ await run('./dist', {
4040
viewports: 'mobile:375x667,desktop:1920x1080',
4141
concurrency: 3,
4242
}, {
43-
logger: console,
43+
output: console,
4444
config: vizzlyConfig,
4545
services: serviceContainer,
4646
});

0 commit comments

Comments
 (0)