Fix samples (#474)
This commit is contained in:
Родитель
4b85305921
Коммит
5af9e5ce2c
|
@ -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
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче