@@ -49,33 +49,28 @@ describe('LDP', function () {
4949 } )
5050 } )
5151
52- describe ( 'readContainerMeta' , function ( ) {
53- it ( 'should return 404 if .meta is not found' , function ( done ) {
54- ldp . readContainerMeta ( 'resources/' , function ( err ) {
52+ describe ( 'readContainerMeta' , ( ) => {
53+ it ( 'should return 404 if .meta is not found' , ( ) => {
54+ return ldp . readContainerMeta ( '/ resources/' ) . catch ( err => {
5555 assert . equal ( err . status , 404 )
56- done ( )
5756 } )
5857 } )
5958
60- it ( 'should return content if metaFile exists' , function ( done ) {
59+ it ( 'should return content if metaFile exists' , ( ) => {
6160 // file can be empty as well
6261 write ( 'This function just reads this, does not parse it' , '.meta' )
63- ldp . readContainerMeta ( path . join ( __dirname , '.. /resources/') , function ( err , metaFile ) {
62+ return ldp . readContainerMeta ( ' /resources/') . then ( metaFile => {
6463 rm ( '.meta' )
65- assert . notOk ( err )
6664 assert . equal ( metaFile , 'This function just reads this, does not parse it' )
67- done ( )
6865 } )
6966 } )
7067
71- it ( 'should work also if trailing `/` is not passed' , function ( done ) {
68+ it ( 'should work also if trailing `/` is not passed' , ( ) => {
7269 // file can be empty as well
7370 write ( 'This function just reads this, does not parse it' , '.meta' )
74- ldp . readContainerMeta ( path . join ( __dirname , '.. /resources') , function ( err , metaFile ) {
71+ return ldp . readContainerMeta ( ' /resources') . then ( metaFile => {
7572 rm ( '.meta' )
76- assert . notOk ( err )
7773 assert . equal ( metaFile , 'This function just reads this, does not parse it' )
78- done ( )
7974 } )
8075 } )
8176 } )
0 commit comments