Skip to content

Commit 5af9e5c

Browse files
author
Maxim Zaytsev
authored
Fix samples (#474)
1 parent 4b85305 commit 5af9e5c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

samples/task.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ export async function run() {
4242

4343
// upload a secure file
4444
let s = new stream.Readable();
45+
let testString: string = 'test file contents';
4546
s._read = function noop() {};
46-
s.push("test file contents");
47+
s.push(testString);
4748
s.push(null);
4849
let name = `vstsnodeapitest${new Date().getTime()}`;
4950
console.log("uploading file");
50-
let secureFile = await vstsTask.uploadSecureFile(null, s, project, name);
51+
const headers = { 'Content-Length': testString.length };
52+
let secureFile = await vstsTask.uploadSecureFile(headers, s, project, name);
5153
console.log(`uploaded secure file ${secureFile.name}`);
5254

5355
// delete it

samples/workItemTracking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ export async function run() {
6767
if (workItemTypes.length > 0) {
6868
const type: WorkItemTrackingInterfaces.WorkItemType = workItemTypes[0];
6969
common.heading('Info for type' + type.name);
70-
console.log(type.name, 'has', (await witApi.getWorkItemTypeColors([project.id])).length, 'colors');
70+
console.log(type.name, 'has', (await witApi.getWorkItemTypeColors([project.name])).length, 'colors');
7171
}
7272
}

0 commit comments

Comments
 (0)