Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
User Account
Commits
2a084f63
Commit
2a084f63
authored
Apr 21, 2021
by
Rosanny Sihombing
Browse files
update test unit
parent
6447e044
Changes
2
Hide whitespace changes
Inline
Side-by-side
__tests__/gitlab.unit.test.js
View file @
2a084f63
...
...
@@ -4,7 +4,7 @@ const gitlab = require('../routes/gitlab')
describe
(
'
GitLab API
'
,
()
=>
{
test
(
'
returns an existing gitlab user by an email address
'
,
async
()
=>
{
let
user
=
await
gitlab
.
getUserByEmail
(
'
putavaliduseremailaddress@here
.com
'
)
let
user
=
await
gitlab
.
getUserByEmail
(
'
litehon958@whipjoy
.com
'
)
expect
(
user
).
not
.
toBeNull
()
})
test
(
'
returns an undefined user
'
,
async
()
=>
{
...
...
@@ -13,7 +13,7 @@ describe('GitLab API', () => {
})
test
(
'
returns users project
'
,
async
()
=>
{
let
userProjects
=
await
gitlab
.
getUserProjects
(
'
put a valid user id in integer here
'
)
let
userProjects
=
await
gitlab
.
getUserProjects
(
136
)
expect
(
userProjects
).
toBeDefined
()
})
test
(
'
returns undefined projects, due to non-existing gitlab user ID
'
,
async
()
=>
{
...
...
__tests__/method.unit.test.js
View file @
2a084f63
...
...
@@ -3,7 +3,7 @@ const methods = require('../routes/methods')
describe
(
"
DB methohds test
"
,
()
=>
{
it
(
'
returns a user from DB by email
'
,
done
=>
{
methods
.
getUserByEmail
(
'
rosanny.sihombing@hft-stuttgart.de
'
,
function
(
resp
,
err
){
methods
.
getUserByEmail
(
'
litehon958@whipjoy.com
'
,
function
(
resp
,
err
){
try
{
expect
(
resp
).
not
.
toBeNull
()
expect
(
err
).
toBeNull
()
...
...
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