chore: throw error upon failed premium account activation in tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import * as Defaults from './Defaults.js'
|
import * as Defaults from './Defaults.js'
|
||||||
|
|
||||||
export async function publishMockedEvent(eventType, eventPayload) {
|
export async function publishMockedEvent(eventType, eventPayload) {
|
||||||
await fetch(`${Defaults.getDefaultMockedEventServiceUrl()}/events`, {
|
const response = await fetch(`${Defaults.getDefaultMockedEventServiceUrl()}/events`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
@@ -12,4 +12,10 @@ export async function publishMockedEvent(eventType, eventPayload) {
|
|||||||
eventPayload,
|
eventPayload,
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (response.status !== 200) {
|
||||||
|
const responseText = await response.text()
|
||||||
|
|
||||||
|
throw new Error(`Failed to publish mocked event: ${responseText}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user