@@ -22,7 +22,7 @@ const intoStream = require('into-stream')
2222
2323describe ( 'LDP' , function ( ) {
2424 console . log ( __dirname )
25- const root = path . join ( __dirname , '../resources/ldp-test/ ' )
25+ const root = path . join ( __dirname , '../resources/ldp-test' )
2626 console . log ( root )
2727 const resourceMapper = new ResourceMapper ( {
2828 rootUrl : 'https://localhost:8443/' ,
@@ -39,7 +39,8 @@ describe('LDP', function () {
3939
4040 this . beforeAll ( ( ) => {
4141 fs . mkdirSync ( root , { recursive : true } )
42- fs . mkdirSync ( `${ root } /resources/` , { recursive : true } )
42+ fs . mkdirSync ( path . join ( root , '/resources/' ) , { recursive : true } )
43+ fs . mkdirSync ( path . join ( root , '/resources/sampleContainer/' ) , { recursive : true } )
4344 } )
4445
4546 this . afterAll ( ( ) => {
@@ -70,7 +71,7 @@ describe('LDP', function () {
7071
7172 it ( 'return file if file exists' , ( ) => {
7273 // file can be empty as well
73- fs . writeFileSync ( ` ${ root } /resources/fileExists.txt` , 'hello world' )
74+ fs . writeFileSync ( path . join ( root , ' /resources/fileExists.txt' ) , 'hello world' )
7475 return ldp . readResource ( '/resources/fileExists.txt' ) . then ( file => {
7576 assert . equal ( file , 'hello world' )
7677 } )
@@ -86,18 +87,20 @@ describe('LDP', function () {
8687
8788 it ( 'should return content if metaFile exists' , ( ) => {
8889 // file can be empty as well
89- write ( 'This function just reads this, does not parse it' , 'sampleContainer/.meta' )
90+ // write('This function just reads this, does not parse it', 'sampleContainer/.meta')
91+ fs . writeFileSync ( path . join ( root , 'resources/sampleContainer/.meta' ) , 'This function just reads this, does not parse it' )
9092 return ldp . readContainerMeta ( '/resources/sampleContainer/' ) . then ( metaFile => {
91- rm ( 'sampleContainer/.meta' )
93+ // rm('sampleContainer/.meta')
9294 assert . equal ( metaFile , 'This function just reads this, does not parse it' )
9395 } )
9496 } )
9597
9698 it ( 'should work also if trailing `/` is not passed' , ( ) => {
9799 // file can be empty as well
98- write ( 'This function just reads this, does not parse it' , 'sampleContainer/.meta' )
100+ // write('This function just reads this, does not parse it', 'sampleContainer/.meta')
101+ fs . writeFileSync ( path . join ( root , 'resources/sampleContainer/.meta' ) , 'This function just reads this, does not parse it' )
99102 return ldp . readContainerMeta ( '/resources/sampleContainer' ) . then ( metaFile => {
100- rm ( 'sampleContainer/.meta' )
103+ // rm('sampleContainer/.meta')
101104 assert . equal ( metaFile , 'This function just reads this, does not parse it' )
102105 } )
103106 } )
0 commit comments