File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ process.env.NODE_ENV = 'test';
33const chai = require ( 'chai' ) ;
44const chaiHttp = require ( 'chai-http' ) ;
55const server = require ( '../index.js' ) ;
6+ const mimeType = require ( '../modules/mimeType' ) ;
67
78chai . use ( chaiHttp ) ;
89
@@ -13,6 +14,17 @@ describe('/GET files', () => {
1314 . end ( ( err , res ) => {
1415 chai . expect ( res . status ) . to . equal ( 200 ) ;
1516 chai . expect ( res . body ) . to . be . an ( 'array' ) ;
17+ chai . expect ( res . type ) . to . equal ( mimeType [ '.json' ] ) ;
18+ done ( ) ;
19+ } ) ;
20+ } ) ;
21+
22+ it ( 'it should GET webviewer.pdf' , ( done ) => {
23+ chai . request ( server )
24+ . get ( '/files/webviewer.pdf' )
25+ . end ( ( err , res ) => {
26+ chai . expect ( res . status ) . to . equal ( 200 ) ;
27+ chai . expect ( res . type ) . to . equal ( mimeType [ '.pdf' ] ) ;
1628 done ( ) ;
1729 } ) ;
1830 } ) ;
You can’t perform that action at this time.
0 commit comments