Skip to content

Commit c22100c

Browse files
Fixes bug in returning lists. Closes #1667
1 parent e8f399b commit c22100c

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/o365/spo/commands/list/list-list.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ describe(commands.LIST_LIST, () => {
126126
webUrl: 'https://contoso.sharepoint.com'
127127
} }, () => {
128128
try {
129-
assert(cmdInstanceLogSpy.calledWith({value: [{
129+
assert(cmdInstanceLogSpy.calledWith([{
130130
AllowContentTypes: true,
131131
BaseTemplate: 109,
132132
BaseType: 1,
@@ -178,7 +178,7 @@ describe(commands.LIST_LIST, () => {
178178
TemplateFeatureId: null,
179179
Title: 'Documents',
180180
RootFolder: {ServerRelativeUrl: 'Documents'}
181-
}]}));
181+
}]));
182182
done();
183183
}
184184
catch (e) {

src/o365/spo/commands/list/list-list.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ class ListListCommand extends SpoCommand {
5454
.get<ListInstanceCollection>(requestOptions)
5555
.then((listInstances: ListInstanceCollection): void => {
5656
if (args.options.output === 'json') {
57-
cmd.log(listInstances);
57+
if (listInstances.value) {
58+
cmd.log(listInstances.value);
59+
}
5860
}
5961
else {
6062
cmd.log(listInstances.value.map(l => {

0 commit comments

Comments
 (0)