kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
fix: run tests serially and update error message
rodzic
33069bed5e
commit
03637e8596
|
@ -4,7 +4,7 @@ import { TwilioConversationClient } from '@/services/twilio-conversation'
|
||||||
|
|
||||||
import './_utils'
|
import './_utils'
|
||||||
|
|
||||||
test('TwilioConversationClient.createConversation', async (t) => {
|
test.serial('TwilioConversationClient.createConversation', async (t) => {
|
||||||
if (!process.env.TWILIO_ACCOUNT_SID || !process.env.TWILIO_AUTH_TOKEN) {
|
if (!process.env.TWILIO_ACCOUNT_SID || !process.env.TWILIO_AUTH_TOKEN) {
|
||||||
return t.pass()
|
return t.pass()
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ test('TwilioConversationClient.createConversation', async (t) => {
|
||||||
await client.deleteConversation(conversation.sid)
|
await client.deleteConversation(conversation.sid)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('TwilioConversationClient.addParticipant', async (t) => {
|
test.serial('TwilioConversationClient.addParticipant', async (t) => {
|
||||||
if (
|
if (
|
||||||
!process.env.TWILIO_ACCOUNT_SID ||
|
!process.env.TWILIO_ACCOUNT_SID ||
|
||||||
!process.env.TWILIO_AUTH_TOKEN ||
|
!process.env.TWILIO_AUTH_TOKEN ||
|
||||||
|
@ -41,7 +41,7 @@ test('TwilioConversationClient.addParticipant', async (t) => {
|
||||||
await client.deleteConversation(conversationSid)
|
await client.deleteConversation(conversationSid)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('TwilioConversationClient.sendMessage', async (t) => {
|
test.serial('TwilioConversationClient.sendMessage', async (t) => {
|
||||||
if (!process.env.TWILIO_ACCOUNT_SID || !process.env.TWILIO_AUTH_TOKEN) {
|
if (!process.env.TWILIO_ACCOUNT_SID || !process.env.TWILIO_AUTH_TOKEN) {
|
||||||
return t.pass()
|
return t.pass()
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ test('TwilioConversationClient.sendMessage', async (t) => {
|
||||||
await client.deleteConversation(conversationSid)
|
await client.deleteConversation(conversationSid)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('TwilioConversationClient.fetchMessages', async (t) => {
|
test.serial('TwilioConversationClient.fetchMessages', async (t) => {
|
||||||
if (!process.env.TWILIO_ACCOUNT_SID || !process.env.TWILIO_AUTH_TOKEN) {
|
if (!process.env.TWILIO_ACCOUNT_SID || !process.env.TWILIO_AUTH_TOKEN) {
|
||||||
return t.pass()
|
return t.pass()
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ test('TwilioConversationClient.fetchMessages', async (t) => {
|
||||||
await client.deleteConversation(conversationSid)
|
await client.deleteConversation(conversationSid)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('TwilioConversationClient.sendAndWaitForReply', async (t) => {
|
test.serial('TwilioConversationClient.sendAndWaitForReply', async (t) => {
|
||||||
if (
|
if (
|
||||||
!process.env.TWILIO_ACCOUNT_SID ||
|
!process.env.TWILIO_ACCOUNT_SID ||
|
||||||
!process.env.TWILIO_AUTH_TOKEN ||
|
!process.env.TWILIO_AUTH_TOKEN ||
|
||||||
|
@ -101,12 +101,14 @@ test('TwilioConversationClient.sendAndWaitForReply', async (t) => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
instanceOf: Error,
|
instanceOf: Error,
|
||||||
message: 'Reached timeout waiting for reply'
|
message: 'Twilio timeout waiting for reply'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('TwilioConversationClient.sendAndWaitForReply.stopSignal', async (t) => {
|
test.serial(
|
||||||
|
'TwilioConversationClient.sendAndWaitForReply.stopSignal',
|
||||||
|
async (t) => {
|
||||||
if (
|
if (
|
||||||
!process.env.TWILIO_ACCOUNT_SID ||
|
!process.env.TWILIO_ACCOUNT_SID ||
|
||||||
!process.env.TWILIO_AUTH_TOKEN ||
|
!process.env.TWILIO_AUTH_TOKEN ||
|
||||||
|
@ -139,4 +141,5 @@ test('TwilioConversationClient.sendAndWaitForReply.stopSignal', async (t) => {
|
||||||
message: 'Aborted'
|
message: 'Aborted'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
|
Ładowanie…
Reference in New Issue