chatgpt-api/test/novu.test.ts

29 wiersze
511 B
TypeScript
Czysty Zwykły widok Historia

2023-06-08 21:10:46 +00:00
import test from 'ava'
2023-06-09 01:41:28 +00:00
import { NovuClient } from '@/services/novu'
2023-06-08 21:10:46 +00:00
import './_utils'
test('NovuClient.triggerEvent', async (t) => {
if (!process.env.NOVU_API_KEY) {
return t.pass()
}
t.timeout(2 * 60 * 1000)
const client = new NovuClient()
const result = await client.triggerEvent({
name: 'send-email',
payload: {
content: 'Hello World!'
},
to: [
{
subscriberId: '123456',
email: 'pburckhardt@outlook.com'
}
]
})
t.truthy(result)
})