mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: race condition in test
This commit is contained in:
@@ -147,7 +147,8 @@ describe('Analytics', () => {
|
|||||||
|
|
||||||
const metrics = ['activities', 'activities:byType:Like', 'activities:byHost:example.org'];
|
const metrics = ['activities', 'activities:byType:Like', 'activities:byHost:example.org'];
|
||||||
metrics.forEach((metric) => {
|
metrics.forEach((metric) => {
|
||||||
assert(before[metric] && after[metric], JSON.stringify({ before, after }, null, 2));
|
before[metric] = before[metric] || 0;
|
||||||
|
assert(before.hasOwnProperty(metric) && after.hasOwnProperty(metric), JSON.stringify({ before, after }, null, 2));
|
||||||
assert(before[metric] < after[metric]);
|
assert(before[metric] < after[metric]);
|
||||||
});
|
});
|
||||||
analytics.pause = false;
|
analytics.pause = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user