Skip to content

Commit

Permalink
Fix samples (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Zaytsev authored Nov 15, 2021
1 parent 4b85305 commit 5af9e5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions samples/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ export async function run() {

// upload a secure file
let s = new stream.Readable();
let testString: string = 'test file contents';
s._read = function noop() {};
s.push("test file contents");
s.push(testString);
s.push(null);
let name = `vstsnodeapitest${new Date().getTime()}`;
console.log("uploading file");
let secureFile = await vstsTask.uploadSecureFile(null, s, project, name);
const headers = { 'Content-Length': testString.length };
let secureFile = await vstsTask.uploadSecureFile(headers, s, project, name);
console.log(`uploaded secure file ${secureFile.name}`);

// delete it
Expand Down
2 changes: 1 addition & 1 deletion samples/workItemTracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ export async function run() {
if (workItemTypes.length > 0) {
const type: WorkItemTrackingInterfaces.WorkItemType = workItemTypes[0];
common.heading('Info for type' + type.name);
console.log(type.name, 'has', (await witApi.getWorkItemTypeColors([project.id])).length, 'colors');
console.log(type.name, 'has', (await witApi.getWorkItemTypeColors([project.name])).length, 'colors');
}
}

0 comments on commit 5af9e5c

Please sign in to comment.