本文整理匯總了TypeScript中vs/workbench/services/backup/node/backupFileService.BackupFileService.backupResource方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript BackupFileService.backupResource方法的具體用法?TypeScript BackupFileService.backupResource怎麽用?TypeScript BackupFileService.backupResource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/workbench/services/backup/node/backupFileService.BackupFileService
的用法示例。
在下文中一共展示了BackupFileService.backupResource方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('backupResource - text file', function (done: () => void) {
service.backupResource(fooFile, 'test').then(() => {
assert.equal(fs.readdirSync(path.join(workspaceBackupPath, 'file')).length, 1);
assert.equal(fs.existsSync(fooBackupPath), true);
assert.equal(fs.readFileSync(fooBackupPath), 'test');
done();
});
});
示例2:
service.backupResource(fooFile, 'test').then(() => {
assert.equal(fs.readdirSync(path.join(workspaceBackupPath, 'file')).length, 1);
service.backupResource(barFile, 'test').then(() => {
assert.equal(fs.readdirSync(path.join(workspaceBackupPath, 'file')).length, 2);
service.discardAllWorkspaceBackups().then(() => {
assert.equal(fs.existsSync(fooBackupPath), false);
assert.equal(fs.existsSync(barBackupPath), false);
assert.equal(fs.existsSync(path.join(workspaceBackupPath, 'file')), false);
done();
});
});
});