Skip to content

Commit

Permalink
test: metricsNotified support
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Aug 9, 2024
1 parent 8fd2800 commit 88bed39
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/inter-protocol/test/vaultFactory/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ export const makeManagerDriver = async (
publicTopics.asset.subscriber,
);
let managerNotification = await E(managerNotifier).getUpdateSince();
const metricsNotifier = await makeNotifierFromSubscriber(
publicTopics.metrics.subscriber,
);
let metricsNotification = await E(metricsNotifier).getUpdateSince();

/** @type {UserSeat} */
let currentSeat;
Expand Down Expand Up @@ -556,6 +560,21 @@ export const makeManagerDriver = async (
}
return managerNotification;
},
/**
* @param {object} [likeExpected]
* @param {AT_NEXT | number} [optSince] AT_NEXT is an alias for updateCount
* of the last update, forcing to wait for another
*/
metricsNotified: async (likeExpected, optSince) => {
metricsNotification = await E(metricsNotifier).getUpdateSince(
optSince === AT_NEXT ? metricsNotification.updateCount : optSince,
);
trace(t, 'metrics notifier', metricsNotification);
if (likeExpected) {
t.like(metricsNotification.value, likeExpected);
}
return managerNotification;
},
checkReserveAllocation: async stableValue => {
const { reserveCreatorFacet } = t.context;
const reserveAllocations = await E(reserveCreatorFacet).getAllocations();
Expand Down

0 comments on commit 88bed39

Please sign in to comment.