Skip to content

Commit 705d2ef

Browse files
committed
test: spy on AuthInfo.create
1 parent ac0a267 commit 705d2ef

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/nut/sandboxRefresh.nut.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ describe('Sandbox Refresh', () => {
350350
// @ts-expect-error stubbing private function
351351
sinonSandbox.stub(AuthInfo.prototype, 'getNamespacePrefix').resolves();
352352

353+
const authInfoCreateSpy = sinonSandbox.spy(AuthInfo, 'create');
354+
353355
const result: SandboxProcessObject = await RefreshSandbox.run([
354356
'--name',
355357
sbxName,
@@ -371,7 +373,14 @@ describe('Sandbox Refresh', () => {
371373
expect(sandboxSignupCompleteStub.called, 'sandboxSignupCompleteStub called').to.be.true;
372374
// expect(authInfoExchangeTokenStub.called, 'authInfoExchangeTokenStub called').to.be.true;
373375
// eslint-disable-next-line no-console
374-
console.dir(authInfoExchangeTokenStub, { depth: 8 });
376+
console.log(authInfoCreateSpy.callCount);
377+
// eslint-disable-next-line no-console
378+
console.dir(authInfoCreateSpy.firstCall.args);
379+
// eslint-disable-next-line no-console
380+
console.dir(authInfoCreateSpy.secondCall.args);
381+
// eslint-disable-next-line no-console
382+
console.dir(authInfoCreateSpy.thirdCall.args);
383+
assert(authInfoExchangeTokenStub);
375384

376385
// Check auth files exist
377386
const authFileContents = readAuthFile(session.homeDir, sbxAuthResponse.authUserName);

0 commit comments

Comments
 (0)