Fix tests
This commit is contained in:
@@ -65,7 +65,7 @@ describe('Storage', function () {
|
||||
const sourceFile = path.join(__dirname, 'storage/data/test.txt');
|
||||
const sourceStream = fs.createReadStream(sourceFile);
|
||||
const destFile = path.join(gBackupConfig.backupDir, gBackupConfig.prefix, '/uploadtest/test.txt');
|
||||
const uploader = await filesystem.upload(gBackupConfig, 'uploadtest/test.txt');
|
||||
const uploader = await filesystem.upload(gBackupConfig, {}, 'uploadtest/test.txt');
|
||||
await stream.pipeline(sourceStream, uploader.stream);
|
||||
await uploader.finish();
|
||||
expect(fs.existsSync(destFile));
|
||||
@@ -76,7 +76,7 @@ describe('Storage', function () {
|
||||
const sourceFile = path.join(__dirname, 'storage/data/empty');
|
||||
const sourceStream = fs.createReadStream(sourceFile);
|
||||
const destFile = path.join(gBackupConfig.backupDir, gBackupConfig.prefix, '/uploadtest/empty');
|
||||
const uploader = await filesystem.upload(gBackupConfig, destFile);
|
||||
const uploader = await filesystem.upload(gBackupConfig, {}, destFile);
|
||||
await stream.pipeline(sourceStream, uploader.stream);
|
||||
await uploader.finish();
|
||||
expect(fs.existsSync(destFile));
|
||||
@@ -88,7 +88,7 @@ describe('Storage', function () {
|
||||
const sourceStream = fs.createReadStream(sourceFile);
|
||||
const destFile = path.join(gBackupConfig.backupDir, gBackupConfig.prefix, '/uploadtest/test.txt');
|
||||
const oldStat = fs.statSync(destFile);
|
||||
const uploader = await filesystem.upload(gBackupConfig, 'uploadtest/test.txt');
|
||||
const uploader = await filesystem.upload(gBackupConfig, {}, 'uploadtest/test.txt');
|
||||
await stream.pipeline(sourceStream, uploader.stream);
|
||||
await uploader.finish();
|
||||
expect(fs.existsSync(destFile)).to.be(true);
|
||||
@@ -245,7 +245,7 @@ describe('Storage', function () {
|
||||
const sourceFile = path.join(__dirname, 'storage/data/test.txt');
|
||||
const sourceStream = fs.createReadStream(sourceFile);
|
||||
const destKey = 'uploadtest/test.txt';
|
||||
const uploader = await s3.upload(backupConfig, destKey);
|
||||
const uploader = await s3.upload(backupConfig, {}, destKey);
|
||||
await stream.pipeline(sourceStream, uploader.stream);
|
||||
await uploader.finish();
|
||||
expect(fs.existsSync(path.join(bucketPath, destKey))).to.be(true);
|
||||
@@ -275,7 +275,7 @@ describe('Storage', function () {
|
||||
it('can copy', async function () {
|
||||
fs.writeFileSync(path.join(bucketPath, 'uploadtest/C++.gitignore'), 'special', 'utf8');
|
||||
|
||||
await s3.copyDir(backupConfig, 'uploadtest', 'uploadtest-copy', () => {});
|
||||
await s3.copyDir(backupConfig, {}, 'uploadtest', 'uploadtest-copy', () => {});
|
||||
const sourceFile = path.join(__dirname, 'storage/data/test.txt');
|
||||
expect(fs.statSync(path.join(bucketPath, 'uploadtest-copy/test.txt')).size).to.be(fs.statSync(sourceFile).size);
|
||||
expect(fs.statSync(path.join(bucketPath, 'uploadtest-copy/C++.gitignore')).size).to.be(7);
|
||||
@@ -382,7 +382,7 @@ describe('Storage', function () {
|
||||
const sourceFile = path.join(__dirname, 'storage/data/test.txt');
|
||||
const sourceStream = fs.createReadStream(sourceFile);
|
||||
const destKey = 'uploadtest/test.txt';
|
||||
const uploader = await gcs.upload(backupConfig, destKey);
|
||||
const uploader = await gcs.upload(backupConfig, {}, destKey);
|
||||
await stream.pipeline(sourceStream, uploader.stream);
|
||||
await uploader.finish();
|
||||
expect(fs.existsSync(path.join(bucketPath, destKey))).to.be(true);
|
||||
@@ -412,7 +412,7 @@ describe('Storage', function () {
|
||||
it('can copy', async function () {
|
||||
fs.writeFileSync(path.join(bucketPath, 'uploadtest/C++.gitignore'), 'special', 'utf8');
|
||||
|
||||
await gcs.copyDir(backupConfig, 'uploadtest', 'uploadtest-copy', () => {});
|
||||
await gcs.copyDir(backupConfig, {}, 'uploadtest', 'uploadtest-copy', () => {});
|
||||
const sourceFile = path.join(__dirname, 'storage/data/test.txt');
|
||||
expect(fs.statSync(path.join(bucketPath, 'uploadtest-copy/test.txt')).size).to.be(fs.statSync(sourceFile).size);
|
||||
expect(fs.statSync(path.join(bucketPath, 'uploadtest-copy/C++.gitignore')).size).to.be(7);
|
||||
|
||||
Reference in New Issue
Block a user