@@ -363,10 +363,21 @@ describe('debug', () => {
363
363
const actual = createConfigId ( { fqbn : 'a:b:c' } , 'p' ) ;
364
364
assert . strictEqual ( actual , 'a:b:c:programmer=p' ) ;
365
365
} ) ;
366
+
367
+ it ( 'should create the configuration ID when the FQBN has no custom board options (no programmer)' , ( ) => {
368
+ const actual = createConfigId ( { fqbn : 'a:b:c' } , undefined ) ;
369
+ assert . strictEqual ( actual , 'a:b:c' ) ;
370
+ } ) ;
371
+
366
372
it ( 'should create the configuration ID when the FQBN has custom board options' , ( ) => {
367
373
const actual = createConfigId ( { fqbn : 'a:b:c:o1=v1' } , 'p' ) ;
368
374
assert . strictEqual ( actual , 'a:b:c:o1=v1,programmer=p' ) ;
369
375
} ) ;
376
+
377
+ it ( 'should create the configuration ID when the FQBN has custom board options (no programmer)' , ( ) => {
378
+ const actual = createConfigId ( { fqbn : 'a:b:c:o1=v1' } , undefined ) ;
379
+ assert . strictEqual ( actual , 'a:b:c:o1=v1' ) ;
380
+ } ) ;
370
381
} ) ;
371
382
describe ( 'createName' , ( ) => {
372
383
it ( 'should use the generated config ID if the board name is absent' , ( ) => {
@@ -386,19 +397,37 @@ describe('debug', () => {
386
397
) ;
387
398
} ) ;
388
399
400
+ it ( 'should use the generated config ID with the custom board options if the board name is absent (no programmer)' , ( ) => {
401
+ const board = { fqbn : 'a:b:c:UsbMode=default' } ;
402
+ const actual = createName ( board , undefined ) ;
403
+ assert . strictEqual ( actual , 'Arduino (a:b:c:UsbMode=default)' ) ;
404
+ } ) ;
405
+
389
406
it ( 'should use the board name' , ( ) => {
390
407
const board = { fqbn : 'a:b:c' , name : 'board name' } ;
391
408
const programmer = 'p1' ;
392
409
const actual = createName ( board , programmer ) ;
393
410
assert . strictEqual ( actual , 'board name (p1)' ) ;
394
411
} ) ;
395
412
413
+ it ( 'should use the board name (no programmer)' , ( ) => {
414
+ const board = { fqbn : 'a:b:c' , name : 'board name' } ;
415
+ const actual = createName ( board , undefined ) ;
416
+ assert . strictEqual ( actual , 'board name' ) ;
417
+ } ) ;
418
+
396
419
it ( 'should use the board name and all custom board options' , ( ) => {
397
420
const board = { fqbn : 'a:b:c:UsbMode=default' , name : 'board name' } ;
398
421
const programmer = 'p1' ;
399
422
const actual = createName ( board , programmer ) ;
400
423
assert . strictEqual ( actual , 'board name (UsbMode=default,p1)' ) ;
401
424
} ) ;
425
+
426
+ it ( 'should use the board name and all custom board options (no programmer)' , ( ) => {
427
+ const board = { fqbn : 'a:b:c:UsbMode=default' , name : 'board name' } ;
428
+ const actual = createName ( board , undefined ) ;
429
+ assert . strictEqual ( actual , 'board name (UsbMode=default)' ) ;
430
+ } ) ;
402
431
} ) ;
403
432
404
433
describe ( 'isCustomDebugConfig' , ( ) => {
0 commit comments