@@ -5,7 +5,7 @@ import type { MockInstance } from 'vitest';
55
66import { AUTH_FILE_PATH } from '../../src/lib/consts.js' ;
77import { TEST_USER_BAD_TOKEN , TEST_USER_TOKEN , testUserClient } from '../__setup__/config.js' ;
8- import { useAuthSetup } from '../__setup__/hooks/useAuthSetup.js' ;
8+ import { safeLogin , useAuthSetup } from '../__setup__/hooks/useAuthSetup.js' ;
99
1010vitest . setConfig ( { restoreMocks : false } ) ;
1111useAuthSetup ( ) ;
@@ -25,14 +25,14 @@ describe('apify login and logout', () => {
2525 } ) ;
2626
2727 it ( 'should end with Error with bad token' , async ( ) => {
28- await LoginCommand . run ( [ '--token' , TEST_USER_BAD_TOKEN ] , import . meta . url ) ;
28+ await safeLogin ( TEST_USER_BAD_TOKEN ) ;
2929
3030 expect ( spy ) . toHaveBeenCalledTimes ( 1 ) ;
3131 expect ( spy . mock . calls [ 0 ] [ 0 ] ) . to . include ( 'Error:' ) ;
3232 } ) ;
3333
3434 it ( 'should work with correct token' , async ( ) => {
35- await LoginCommand . run ( [ '--token' , TEST_USER_TOKEN ] , import . meta . url ) ;
35+ await safeLogin ( TEST_USER_TOKEN ) ;
3636
3737 const expectedUserInfo = Object . assign ( await testUserClient . user ( 'me' ) . get ( ) , {
3838 token : TEST_USER_TOKEN ,
@@ -67,6 +67,7 @@ describe('apify login and logout', () => {
6767 } ) ;
6868
6969 it ( 'have correctly setup server for interactive login' , async ( ) => {
70+ // eslint-disable-next-line no-restricted-syntax -- intentional test
7071 await LoginCommand . run ( [ '-m' , 'console' ] , import . meta. url ) ;
7172
7273 const consoleInfo = spy . mock . calls [ 0 ] [ 1 ] ;
0 commit comments