Skip to content

Commit 2627a87

Browse files
committed
feat(plugin-lighthouse): keep audit values as floats
1 parent e9b8fd1 commit 2627a87

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/plugin-lighthouse/src/lib/runner/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function toAuditOutputs(
5050
const auditOutput: AuditOutput = {
5151
slug,
5252
score: score ?? 1, // score can be null
53-
value: Number.parseInt(value.toString(), 10),
53+
value,
5454
displayValue,
5555
};
5656

packages/plugin-lighthouse/src/lib/runner/utils.unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('toAuditOutputs', () => {
9191
).not.toThrow();
9292
});
9393

94-
it('should parse valid lhr float value to integer', () => {
94+
it('should copy lhr numericValue to audit value as float', () => {
9595
expect(
9696
toAuditOutputs([
9797
{
@@ -106,7 +106,7 @@ describe('toAuditOutputs', () => {
106106
displayValue: '2.8 s',
107107
},
108108
]),
109-
).toStrictEqual([expect.objectContaining({ value: 2838 })]);
109+
).toStrictEqual([expect.objectContaining({ value: 2838.974 })]);
110110
});
111111

112112
it('should convert null score to 1', () => {

0 commit comments

Comments
 (0)