sistema_web/private-dynamic/static/testHelpers.js

21 lines
515 B
JavaScript
Raw Permalink Normal View History

2023-02-27 16:21:22 -03:00
function _expectThrewEvent(dispatchEventMock, eventType) {
for (const call of dispatchEventMock.calls) {
if (call[0].type == eventType) {
return true;
}
}
throw `${eventType} expected but not dispatched`;
}
function _expectDidntThrowEvent(dispatchEventMock, eventType) {
for (const call of dispatchEventMock.calls) {
if (call[0].type == eventType) {
throw `${eventType} dispatched but not expected`;
}
}
return true;
}
export { _expectThrewEvent, _expectDidntThrowEvent }