Commit 2b171ca0 authored by Tim Kinnane's avatar Tim Kinnane
Browse files

test(pretest): Fix handling of user/room errors

parent f5407e87
......@@ -110,7 +110,7 @@ export async function setup () {
// Verify or create user for bot
let botInfo = await userInfo(botUser.username)
if (!botInfo.success) {
if (!botInfo || !botInfo.success) {
console.log(`Bot user (${botUser.username}) not found`)
botInfo = await createUser(botUser)
if (!botInfo.success) {
......@@ -124,7 +124,7 @@ export async function setup () {
// Verify or create mock user for talking to bot
let mockInfo = await userInfo(mockUser.username)
if (!mockInfo.success) {
if (!mockInfo || !mockInfo.success) {
console.log(`Mock user (${mockUser.username}) not found`)
mockInfo = await createUser(mockUser)
if (!mockInfo.success) {
......@@ -138,7 +138,7 @@ export async function setup () {
// Verify or create channel for tests
let testChannelInfo = await channelInfo({ roomName: testChannelName })
if (!testChannelInfo.success) {
if (!testChannelInfo || !testChannelInfo.success) {
console.log(`Test channel (${testChannelName}) not found`)
testChannelInfo = await createChannel(testChannelName)
if (!testChannelInfo.success) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment