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
ST
ga4gh-arraymap
Commits
0c6f7d58
Commit
0c6f7d58
authored
Sep 02, 2016
by
Severine Duvaud
Browse files
Issue
#2
: Integration tests
parent
7ad71679
Changes
2
Show whitespace changes
Inline
Side-by-side
beacon-app/package.json
View file @
0c6f7d58
...
...
@@ -18,5 +18,10 @@
"morgan"
:
"~1.6.1"
,
"serve-favicon"
:
"~2.3.0"
,
"underscore"
:
"^1.8.3"
},
"devDependencies"
:
{
"mocha"
:
"^3.0.2"
,
"chai"
:
"^3.2.0"
,
"chai-http"
:
"^1.0.0"
}
}
beacon-app/test/test-server.js
0 → 100644
View file @
0c6f7d58
// More functional test than Unit tests
// Error with the HTTP request to the API
// (empty object returned due to async)
var
chai
=
require
(
'
chai
'
);
var
chaiHttp
=
require
(
'
chai-http
'
);
var
server
=
require
(
'
../app
'
);
var
should
=
chai
.
should
();
chai
.
use
(
chaiHttp
);
describe
(
'
Beacon arrayMap
'
,
function
()
{
it
(
'
should display the info page
'
,
function
(
done
)
{
chai
.
request
(
server
)
.
get
(
'
/info
'
)
.
end
(
function
(
err
,
res
){
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
be
.
a
(
'
object
'
);
res
.
should
.
not
.
be
.
empty
;
res
.
should
.
have
.
property
(
'
info
'
);
done
();
});
});
it
(
'
should display the sample page, 10 first samples
'
,
function
(
done
)
{
chai
.
request
(
server
)
.
get
(
'
/samples?limit=10
'
)
.
end
(
function
(
err
,
res
){
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
should
.
have
.
lengthOf
(
10
);
res
.
body
[
0
].
should
.
have
.
property
(
'
_id
'
);
res
.
body
[
0
].
should
.
have
.
property
(
'
DIAGNOSISTEXT
'
);
done
();
});
});
it
(
'
should display the query page
'
,
function
(
done
)
{
chai
.
request
(
server
)
.
get
(
'
/v0.4/query
'
)
.
end
(
function
(
err
,
res
){
res
.
should
.
have
.
status
(
200
);
res
.
body
.
should
.
equal
(
'
reference name is not present
'
);
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