You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'First Contentful Paint marks the time at which the first text or image is painted. [Learn more about the First Contentful Paint metric](https://developer.chrome.com/docs/lighthouse/performance/first-contentful-paint/).',
374
+
score: 0.55,
375
+
scoreDisplayMode: 'numeric',
376
+
numericValue: 2838.974,
377
+
numericUnit: 'millisecond',
378
+
displayValue: '2.8 s',
379
+
},
380
+
]),
381
+
).toStrictEqual([
382
+
{
383
+
displayValue: '2.8 s',
384
+
score: 0.55,
385
+
slug: 'first-contentful-paint',
386
+
value: 2838.974,
387
+
},
388
+
]);
389
+
});
390
+
391
+
it('should convert null score to 1',()=>{
392
+
expect(
393
+
toAuditOutputs([
394
+
{
395
+
id: 'performance-budget',
396
+
title: 'Performance budget',
397
+
description:
398
+
'Keep the quantity and size of network requests under the targets set by the provided performance budget. [Learn more about performance budgets](https://developers.google.com/web/tools/lighthouse/audits/budgets).',
it('should inform that opportunity type is not supported yet',()=>{
409
+
constoutputs=toAuditOutputs([
410
+
{
411
+
id: 'dummy-audit',
412
+
title: 'Dummy Audit',
413
+
description: 'This is a dummy audit.',
414
+
score: null,
415
+
scoreDisplayMode: 'informative',
416
+
details: {
417
+
type: 'opportunity',
418
+
headings: [
419
+
{
420
+
key: 'url',
421
+
valueType: 'url',
422
+
label: 'URL',
423
+
},
424
+
{
425
+
key: 'responseTime',
426
+
valueType: 'timespanMs',
427
+
label: 'Time Spent',
428
+
},
429
+
],
430
+
items: [
431
+
{
432
+
url: 'https://staging.code-pushup.dev/login',
433
+
responseTime: 449.292_000_000_000_03,
434
+
},
435
+
],
436
+
overallSavingsMs: 349.292_000_000_000_03,
437
+
}satisfiesDetails.Opportunity,
438
+
},
439
+
]);
440
+
441
+
expect(outputs[0]?.details).toBeUndefined();
442
+
});
443
+
444
+
it('should inform that table type is not supported yet',()=>{
445
+
constoutputs=toAuditOutputs([
446
+
{
447
+
id: 'dummy-audit',
448
+
title: 'Dummy Audit',
449
+
description: 'This is a dummy audit.',
450
+
score: null,
451
+
scoreDisplayMode: 'informative',
452
+
details: {
453
+
type: 'table',
454
+
headings: [],
455
+
items: [],
456
+
},
457
+
},
458
+
]);
459
+
460
+
expect(outputs[0]?.details).toBeUndefined();
461
+
});
462
+
463
+
it('should inform that debugdata type is not supported yet',()=>{
464
+
constoutputs=toAuditOutputs([
465
+
{
466
+
id: 'cumulative-layout-shift',
467
+
title: 'Cumulative Layout Shift',
468
+
description:
469
+
'Cumulative Layout Shift measures the movement of visible elements within the viewport. [Learn more about the Cumulative Layout Shift metric](https://web.dev/cls/).',
it('should inform that treemap-data type is not supported yet',()=>{
537
+
constoutputs=toAuditOutputs([
538
+
{
539
+
id: 'script-treemap-data',
540
+
title: 'Script Treemap Data',
541
+
description: 'Used for treemap app',
542
+
score: null,
543
+
scoreDisplayMode: 'informative',
544
+
details: {
545
+
type: 'treemap-data',
546
+
nodes: [],
547
+
},
548
+
},
549
+
]);
550
+
551
+
expect(outputs[0]?.details).toBeUndefined();
552
+
});
553
+
554
+
it('should inform that criticalrequestchain type is not supported yet',()=>{
555
+
constoutputs=toAuditOutputs([
556
+
{
557
+
id: 'critical-request-chains',
558
+
title: 'Avoid chaining critical requests',
559
+
description:
560
+
'The Critical Request Chains below show you what resources are loaded with a high priority. Consider reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load. [Learn how to avoid chaining critical requests](https://developer.chrome.com/docs/lighthouse/performance/critical-request-chains/).',
0 commit comments