Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
RocketChat
Rocket.Chat.js.SDK
Commits
2b171ca0
Commit
2b171ca0
authored
Aug 08, 2018
by
Tim Kinnane
Browse files
test(pretest): Fix handling of user/room errors
parent
f5407e87
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/utils/testing.ts
View file @
2b171ca0
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment