mirror of
https://github.com/HeyPuter/puter.git
synced 2025-01-23 06:00:21 +08:00
test: cleanup and tweak batch test
One of the test cases has been rendered redundant so it has been removed. Another test was changed to overwrite a file as it's expected to already exist.
This commit is contained in:
parent
d9822a4f09
commit
202e7f06e2
@ -21,9 +21,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
], [
|
], [
|
||||||
'file 1 contents',
|
'file 1 contents',
|
||||||
'file 2 contents',
|
|
||||||
]);
|
]);
|
||||||
console.log('res?', results)
|
|
||||||
expect(results.length).equal(2);
|
expect(results.length).equal(2);
|
||||||
expect(results[0].name).equal('w');
|
expect(results[0].name).equal('w');
|
||||||
expect(results[1].path).equal(t.resolve('q/w/file_1.txt'));
|
expect(results[1].path).equal(t.resolve('q/w/file_1.txt'));
|
||||||
@ -60,28 +58,6 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await t.case('path reference resolution (without dedupe)', async () => {
|
|
||||||
results = null;
|
|
||||||
results = await t.batch('batch', [
|
|
||||||
{
|
|
||||||
op: 'mkdir',
|
|
||||||
as: 'dest_1',
|
|
||||||
path: t.resolve('q/w'),
|
|
||||||
create_missing_parents: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
op: 'write',
|
|
||||||
path: t.resolve('$dest_1/file_1.txt'),
|
|
||||||
},
|
|
||||||
], [
|
|
||||||
'file 1 contents',
|
|
||||||
]);
|
|
||||||
console.log('res?', results)
|
|
||||||
expect(results.length).equal(2);
|
|
||||||
expect(results[0].name).equal('w');
|
|
||||||
expect(results[1].path).equal(t.resolve('q/w/file_1.txt'));
|
|
||||||
});
|
|
||||||
|
|
||||||
// Test for path reference resolution
|
// Test for path reference resolution
|
||||||
await t.case('path reference resolution', async () => {
|
await t.case('path reference resolution', async () => {
|
||||||
results = null;
|
results = null;
|
||||||
@ -94,11 +70,11 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
op: 'write',
|
op: 'write',
|
||||||
|
overwrite: true,
|
||||||
path: t.resolve('$dest_1/file_1.txt'),
|
path: t.resolve('$dest_1/file_1.txt'),
|
||||||
},
|
},
|
||||||
], [
|
], [
|
||||||
'file 1 contents',
|
'file 1 contents',
|
||||||
'file 2 contents',
|
|
||||||
]);
|
]);
|
||||||
console.log('res?', results)
|
console.log('res?', results)
|
||||||
expect(results.length).equal(2);
|
expect(results.length).equal(2);
|
||||||
|
Loading…
Reference in New Issue
Block a user