Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Created July 5, 2020 14:39
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-node
const fileName = "Home_move_plan.mpp";
const localPath = "./Data/" + fileName;
const remotePath = "Temp/Data";
const remoteFullPath = remotePath + "/" + fileName;
await tasksApi.uploadFileToStorage(remoteFullPath, localPath);
const request = new GetTaskDocumentWithFormatRequest();
request.name = fileName;
request.folder = remotePath;
request.format = ProjectFileFormat.Csv;
const result = await tasksApi.getTaskDocumentWithFormat(request);
expect(result.response.statusCode).to.equal(200);
expect(result.body.buffer).is.not.undefined.and.not.null;
const strings = BaseTest.convertArrayBufferToStrings(result.body.buffer);
expect(strings[0]).to.equal("ID;Task_Name;Outline_Level;Duration;Start_Date;Finish_Date;Percent_Comp;Cost;Work");
expect(strings[1]).to.equal("1;Five to Eight Weeks Before Moving;1;16 days;Thu 01.01.04 08:00;Thu 22.01.04 17:00;0%;$0;0 hrs");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment