Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Manish Kumar
webpoke
Commits
c13a4311
Commit
c13a4311
authored
Jun 17, 2020
by
Manish Kumar
Browse files
Backend tests done
parents
9c19d157
a8e93b2e
Changes
3
Hide whitespace changes
Inline
Side-by-side
backend/test/pokemon.js
deleted
100644 → 0
View file @
9c19d157
backend/test/test.js
deleted
100644 → 0
View file @
9c19d157
var
assert
=
require
(
'
assert
'
);
describe
(
'
Array
'
,
function
()
{
describe
(
'
#indexOf()
'
,
function
()
{
it
(
'
should return -1 when the value is not present
'
,
function
()
{
assert
.
equal
([
1
,
2
,
3
].
indexOf
(
4
),
-
1
);
});
});
});
/*describe('User', function() {
describe('#save()', function() {
it('should save without error', function(done) {
var user = new User('Luna');
user.save(function(err) {
if (err) done(err);
else done();
});
});
});
}); async */
\ No newline at end of file
backend/test/
s
erver.js
→
backend/test/
testS
erver.js
View file @
c13a4311
...
...
@@ -4,7 +4,6 @@ var request = require("request");
describe
(
"
Server responses?
"
,
function
()
{
describe
(
"
Recieving the data
"
,
function
()
{
var
url
=
"
http://localhost:3000/checkLogin
"
;
it
(
"
returns negative answer of logging
"
,
function
(
done
)
{
...
...
@@ -19,7 +18,6 @@ describe("Server responses?", function() {
describe
(
"
Showing the friend list?
"
,
function
()
{
var
url
=
"
http://localhost:3000/allfriends
"
;
it
(
"
returns false status
"
,
function
(
done
)
{
request
.
get
(
url
,
function
(
error
,
response
,
body
)
{
var
hey
=
JSON
.
parse
(
body
);
...
...
@@ -28,4 +26,19 @@ describe("Showing the friend list? ", function() {
});
});
});
describe
(
"
Showing pikachu
"
,
function
()
{
var
url
=
"
http://localhost:3000/allpokemon
"
;
it
(
"
returns a pokemon
"
,
function
(
done
)
{
request
(
url
,
function
(
error
,
res
,
body
)
{
var
hey
=
JSON
.
parse
(
body
)
expect
(
hey
[
24
]).
to
.
be
.
an
(
'
object
'
).
that
.
deep
.
includes
({
pokeName
:
'
pikachu
'
});
if
(
error
)
{
return
console
.
error
(
'
this failed:
'
,
error
);
}
done
();
});
});
});
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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