Skip to content

Commit 817fe7a

Browse files
Replace commandOptionsSchema.safeParse with parse in test file
Co-authored-by: martinlingstuyl <5267487+martinlingstuyl@users.noreply.github.com>
1 parent 8913c14 commit 817fe7a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/m365/entra/commands/administrativeunit/administrativeunit-list.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ describe(commands.ADMINISTRATIVEUNIT_LIST, () => {
9292
throw 'Invalid request';
9393
});
9494

95-
const parsedSchema = commandOptionsSchema.safeParse({});
96-
await command.action(logger, { options: parsedSchema.data });
95+
await command.action(logger, { options: commandOptionsSchema.parse({}) });
9796

9897
assert(
9998
loggerLogSpy.calledWith([
@@ -131,8 +130,7 @@ describe(commands.ADMINISTRATIVEUNIT_LIST, () => {
131130
throw 'Invalid request';
132131
});
133132

134-
const parsedSchema = commandOptionsSchema.safeParse({ properties: 'id,displayName' });
135-
await command.action(logger, { options: parsedSchema.data });
133+
await command.action(logger, { options: commandOptionsSchema.parse({ properties: 'id,displayName' }) });
136134

137135
assert(
138136
loggerLogSpy.calledWith([
@@ -156,9 +154,8 @@ describe(commands.ADMINISTRATIVEUNIT_LIST, () => {
156154
throw `Invalid request`;
157155
});
158156

159-
const parsedSchema = commandOptionsSchema.safeParse({});
160157
await assert.rejects(
161-
command.action(logger, { options: parsedSchema.data }),
158+
command.action(logger, { options: commandOptionsSchema.parse({}) }),
162159
new CommandError('An error has occurred')
163160
);
164161
});

0 commit comments

Comments
 (0)