fix: use overwrite to make metadata files work
During a delete the metadata file is updated. As the overwrite property was not set, the metadata couldn't be updated and caused issues.
This commit is contained in:
@ -21,8 +21,20 @@ tap.test('should create a valid smartbucket', async () => {
|
||||
expect(myBucket.name).toEqual('testzone');
|
||||
});
|
||||
|
||||
tap.test('', async () => {
|
||||
|
||||
})
|
||||
tap.test('should put a file into the trash', async () => {
|
||||
const path = 'hithere/socool.txt';
|
||||
const file = await myBucket.fastPut({
|
||||
path,
|
||||
contents: 'hi there!',
|
||||
});
|
||||
expect(await file.getMetaData().then((meta) => meta.metadataFile.getJsonData())).toEqual({});
|
||||
await file.delete({ mode: 'trash' });
|
||||
expect(await file.getMetaData().then((meta) => meta.metadataFile.getJsonData())).toEqual({
|
||||
custom_recycle: {
|
||||
deletedAt: 123,
|
||||
originalPath: 'hithere/socool.txt',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
export default tap.start();
|
||||
export default tap.start();
|
||||
|
@ -41,9 +41,12 @@ tap.test('should get data in bucket', async () => {
|
||||
const fileString = await myBucket.fastGet({
|
||||
path: 'hithere/socool.txt',
|
||||
});
|
||||
const fileStringStream = await myBucket.fastGetStream({
|
||||
path: 'hithere/socool.txt',
|
||||
}, 'nodestream');
|
||||
const fileStringStream = await myBucket.fastGetStream(
|
||||
{
|
||||
path: 'hithere/socool.txt',
|
||||
},
|
||||
'nodestream'
|
||||
);
|
||||
console.log(fileString);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user