Skip to content

Commit a7fffeb

Browse files
committed
Fix tests
1 parent d7843d4 commit a7fffeb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/Jobs/RecordAdditionalMetricTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
(new RecordMetric($data))->handle();
3737

3838
// Count may be 1 (SQLite dedupes by JSON string) or 2 (MySQL compares JSON differently).
39-
$count = Metric::where('name', 'page_views_with_json')->count();
40-
expect($count)->toBeGreaterThanOrEqual(1);
39+
expect(Metric::where('name', 'page_views_with_json')->count())->toBeGreaterThanOrEqual(1);
4140

4241
$metric = Metric::where('name', 'page_views_with_json')->first();
4342

@@ -47,7 +46,7 @@
4746
expect($metric->payload)->toBe(['a' => 1, 'b' => 'test']);
4847

4948
// Total value across all matching records should equal 2 regardless of DB.
50-
expect(Metric::where('name', 'page_views_with_json')->sum('value'))->toBe(2);
49+
expect(Metric::where('name', 'page_views_with_json')->sum('value'))->toEqual(2);
5150
});
5251

5352
it('differentiates metrics by json payload content', function () {
@@ -63,6 +62,5 @@
6362
(new RecordMetric($data2))->handle();
6463

6564
// Count may be 2 (SQLite) or more (MySQL) depending on JSON comparison behavior.
66-
$metricsCount = Metric::where('name', 'page_views_by_source')->count();
67-
expect($metricsCount)->toBeGreaterThanOrEqual(2);
65+
expect(Metric::where('name', 'page_views_by_source')->count())->toBeGreaterThanOrEqual(2);
6866
});

0 commit comments

Comments
 (0)