@@ -12,8 +12,8 @@ import {
1212 beforeEach ,
1313 describe ,
1414 expect ,
15+ it ,
1516 type MockInstance ,
16- test ,
1717 vi ,
1818} from 'vitest' ;
1919import {
@@ -72,7 +72,7 @@ describe('login command', () => {
7272 rmSync ( tmpDir , { recursive : true , force : true } ) ;
7373 } ) ;
7474
75- test ( 'rejects key that fails API validation' , async ( ) => {
75+ it ( 'rejects key that fails API validation' , async ( ) => {
7676 mockDomainListResult = {
7777 data : null ,
7878 error : {
@@ -101,7 +101,7 @@ describe('login command', () => {
101101 expect ( existsSync ( configPath ) ) . toBe ( false ) ;
102102 } ) ;
103103
104- test ( 'rejects key not starting with re_' , async ( ) => {
104+ it ( 'rejects key not starting with re_' , async ( ) => {
105105 setNonInteractive ( ) ;
106106 errorSpy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } ) ;
107107 exitSpy = mockExitThrow ( ) ;
@@ -115,7 +115,7 @@ describe('login command', () => {
115115 expect ( output ) . toContain ( 'invalid_key_format' ) ;
116116 } ) ;
117117
118- test ( 'rejects empty or whitespace-only key with missing_key in non-interactive' , async ( ) => {
118+ it ( 'rejects empty or whitespace-only key with missing_key in non-interactive' , async ( ) => {
119119 setNonInteractive ( ) ;
120120 errorSpy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } ) ;
121121 exitSpy = mockExitThrow ( ) ;
@@ -129,7 +129,7 @@ describe('login command', () => {
129129 expect ( output ) . toContain ( 'missing_key' ) ;
130130 } ) ;
131131
132- test ( 'trims API key before storing' , async ( ) => {
132+ it ( 'trims API key before storing' , async ( ) => {
133133 setNonInteractive ( ) ;
134134
135135 const { loginCommand } = await import ( '../../../src/commands/auth/login' ) ;
@@ -142,7 +142,7 @@ describe('login command', () => {
142142 expect ( data . profiles . default . api_key ) . toBe ( 're_trimmed_key_456' ) ;
143143 } ) ;
144144
145- test ( 'stores valid key to credentials.json and sets active_profile' , async ( ) => {
145+ it ( 'stores valid key to credentials.json and sets active_profile' , async ( ) => {
146146 setupOutputSpies ( ) ;
147147
148148 const { loginCommand } = await import ( '../../../src/commands/auth/login' ) ;
@@ -156,7 +156,7 @@ describe('login command', () => {
156156 expect ( data . active_profile ) . toBe ( 'default' ) ;
157157 } ) ;
158158
159- test ( 'requires --key in non-interactive mode' , async ( ) => {
159+ it ( 'requires --key in non-interactive mode' , async ( ) => {
160160 setupOutputSpies ( ) ;
161161 errorSpy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } ) ;
162162 exitSpy = mockExitThrow ( ) ;
@@ -169,7 +169,7 @@ describe('login command', () => {
169169 expect ( output ) . toContain ( 'missing_key' ) ;
170170 } ) ;
171171
172- test ( 'errors with missing_key when --json is set but --key is omitted even in TTY' , async ( ) => {
172+ it ( 'errors with missing_key when --json is set but --key is omitted even in TTY' , async ( ) => {
173173 Object . defineProperty ( process . stdin , 'isTTY' , {
174174 value : true ,
175175 writable : true ,
@@ -201,7 +201,7 @@ describe('login command', () => {
201201 loginCommand . parent = null ;
202202 } ) ;
203203
204- test ( 'non-interactive login stores as default when profiles exist' , async ( ) => {
204+ it ( 'non-interactive login stores as default when profiles exist' , async ( ) => {
205205 // Pre-populate credentials with an existing profile
206206 const configDir = join ( tmpDir , 'resend' ) ;
207207 mkdirSync ( configDir , { recursive : true } ) ;
@@ -228,7 +228,7 @@ describe('login command', () => {
228228 expect ( data . active_profile ) . toBe ( 'production' ) ;
229229 } ) ;
230230
231- test ( 'auto-switches to profile specified via --profile flag' , async ( ) => {
231+ it ( 'auto-switches to profile specified via --profile flag' , async ( ) => {
232232 setupOutputSpies ( ) ;
233233
234234 const { Command } = await import ( '@commander-js/extra-typings' ) ;
@@ -263,7 +263,7 @@ describe('login command', () => {
263263 expect ( data . profiles . staging . api_key ) . toBe ( 're_staging_key_123' ) ;
264264 } ) ;
265265
266- test ( 'deprecated --team alias works like --profile' , async ( ) => {
266+ it ( 'deprecated --team alias works like --profile' , async ( ) => {
267267 setupOutputSpies ( ) ;
268268
269269 const { Command } = await import ( '@commander-js/extra-typings' ) ;
@@ -287,7 +287,7 @@ describe('login command', () => {
287287 expect ( data . profiles . legacy . api_key ) . toBe ( 're_team_alias_key_123' ) ;
288288 } ) ;
289289
290- test ( 'rejects invalid profile name with invalid_profile_name' , async ( ) => {
290+ it ( 'rejects invalid profile name with invalid_profile_name' , async ( ) => {
291291 setNonInteractive ( ) ;
292292 errorSpy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } ) ;
293293 exitSpy = mockExitThrow ( ) ;
@@ -312,7 +312,7 @@ describe('login command', () => {
312312 expect ( output ) . toContain ( 'invalid_profile_name' ) ;
313313 } ) ;
314314
315- test ( 'trims --profile before storing' , async ( ) => {
315+ it ( 'trims --profile before storing' , async ( ) => {
316316 setupOutputSpies ( ) ;
317317
318318 const { Command } = await import ( '@commander-js/extra-typings' ) ;
@@ -337,7 +337,7 @@ describe('login command', () => {
337337 expect ( data . active_profile ) . toBe ( 'myprofile' ) ;
338338 } ) ;
339339
340- test ( '--json output includes success, config_path, and profile' , async ( ) => {
340+ it ( '--json output includes success, config_path, and profile' , async ( ) => {
341341 setupOutputSpies ( ) ;
342342 const logSpy = vi . spyOn ( console , 'log' ) . mockImplementation ( ( ) => { } ) ;
343343
@@ -363,7 +363,7 @@ describe('login command', () => {
363363 expect ( parsed . profile ) . toBe ( 'prod' ) ;
364364 } ) ;
365365
366- test ( 'accepts sending-only key and stores permission' , async ( ) => {
366+ it ( 'accepts sending-only key and stores permission' , async ( ) => {
367367 mockDomainListResult = {
368368 data : null ,
369369 error : {
@@ -386,7 +386,7 @@ describe('login command', () => {
386386 expect ( data . profiles . default . permission ) . toBe ( 'sending_access' ) ;
387387 } ) ;
388388
389- test ( 'stores full_access permission for valid full access key' , async ( ) => {
389+ it ( 'stores full_access permission for valid full access key' , async ( ) => {
390390 setupOutputSpies ( ) ;
391391
392392 const { loginCommand } = await import ( '../../../src/commands/auth/login' ) ;
@@ -400,7 +400,7 @@ describe('login command', () => {
400400 expect ( data . profiles . default . permission ) . toBe ( 'full_access' ) ;
401401 } ) ;
402402
403- test ( '--json output includes permission for sending-only key' , async ( ) => {
403+ it ( '--json output includes permission for sending-only key' , async ( ) => {
404404 mockDomainListResult = {
405405 data : null ,
406406 error : {
0 commit comments