@@ -403,27 +403,11 @@ describe('format', function () {
403
403
checker ( themePath ( '005-compile/invalid' ) ) . then ( ( theme ) => {
404
404
theme = format ( theme ) ;
405
405
406
- theme . results . error . length . should . eql ( 16 ) ;
407
- theme . results . error [ 0 ] . fatal . should . eql ( true ) ;
408
- // theme.results.error[1].fatal.should.eql(true);
409
- // theme.results.error[2].fatal.should.eql(true);
410
- theme . results . error [ 3 ] . fatal . should . eql ( false ) ;
411
- // theme.results.error[10].fatal.should.eql(false);
406
+ theme . results . error . length . should . eql ( 15 ) ;
407
+ theme . results . fatal . length . should . eql ( 1 ) ;
412
408
413
- done ( ) ;
414
- } ) . catch ( done ) ;
415
- } ) ;
416
-
417
- it ( 'assert sorting' , function ( done ) {
418
- checker ( themePath ( 'is-empty' ) ) . then ( ( theme ) => {
419
- theme = format ( theme ) ;
420
-
421
- theme . results . error [ 0 ] . fatal . should . eql ( true ) ;
422
- theme . results . error [ 1 ] . fatal . should . eql ( true ) ;
423
- theme . results . error [ 4 ] . fatal . should . eql ( false ) ;
424
- theme . results . error [ 10 ] . fatal . should . eql ( false ) ;
425
- theme . results . error [ 11 ] . fatal . should . eql ( false ) ;
426
- theme . results . error [ 12 ] . fatal . should . eql ( false ) ;
409
+ theme . results . error [ 0 ] . fatal . should . eql ( false ) ;
410
+ theme . results . fatal [ 0 ] . fatal . should . eql ( true ) ;
427
411
428
412
done ( ) ;
429
413
} ) . catch ( done ) ;
@@ -441,13 +425,16 @@ describe('format', function () {
441
425
theme . results . warning . all . length . should . eql ( 3 ) ;
442
426
theme . results . warning . byFiles [ 'default.hbs' ] . length . should . eql ( 2 ) ;
443
427
444
- theme . results . error . all . length . should . eql ( 16 ) ;
428
+ theme . results . error . all . length . should . eql ( 15 ) ;
429
+ theme . results . fatal . all . length . should . eql ( 1 ) ;
445
430
446
431
// 1 rule has file references
447
- theme . results . error . byFiles [ 'author.hbs' ] . length . should . eql ( 1 ) ;
448
- theme . results . error . byFiles [ 'page.hbs' ] . length . should . eql ( 1 ) ;
449
- theme . results . error . byFiles [ 'post.hbs' ] . length . should . eql ( 1 ) ;
450
- theme . results . error . byFiles [ 'index.hbs' ] . length . should . eql ( 1 ) ;
432
+ theme . results . fatal . byFiles [ 'author.hbs' ] . length . should . eql ( 1 ) ;
433
+ theme . results . fatal . byFiles [ 'page.hbs' ] . length . should . eql ( 1 ) ;
434
+ theme . results . fatal . byFiles [ 'post.hbs' ] . length . should . eql ( 1 ) ;
435
+ theme . results . fatal . byFiles [ 'index.hbs' ] . length . should . eql ( 1 ) ;
436
+
437
+ theme . results . error . byFiles [ 'default.hbs' ] . length . should . eql ( 1 ) ;
451
438
theme . results . error . byFiles [ 'package.json' ] . length . should . eql ( 9 ) ;
452
439
453
440
done ( ) ;
@@ -463,14 +450,24 @@ describe('format', function () {
463
450
theme . results . recommendation . all . length . should . eql ( 2 ) ;
464
451
theme . results . recommendation . byFiles [ 'package.json' ] . length . should . eql ( 1 ) ;
465
452
466
- theme . results . error . all . length . should . eql ( 88 ) ;
453
+ theme . results . fatal . all . length . should . eql ( 23 ) ;
454
+ theme . results . error . all . length . should . eql ( 65 ) ;
467
455
theme . results . warning . all . length . should . eql ( 2 ) ;
468
456
469
457
theme . results . error . byFiles [ 'assets/my.css' ] . length . should . eql ( 3 ) ;
470
- theme . results . error . byFiles [ 'default.hbs' ] . length . should . eql ( 17 ) ;
471
- theme . results . error . byFiles [ 'post.hbs' ] . length . should . eql ( 54 ) ;
472
- theme . results . error . byFiles [ 'partials/mypartial.hbs' ] . length . should . eql ( 5 ) ;
473
- theme . results . error . byFiles [ 'index.hbs' ] . length . should . eql ( 9 ) ;
458
+
459
+ theme . results . error . byFiles [ 'default.hbs' ] . length . should . eql ( 13 ) ;
460
+ theme . results . fatal . byFiles [ 'default.hbs' ] . length . should . eql ( 4 ) ;
461
+
462
+ theme . results . error . byFiles [ 'post.hbs' ] . length . should . eql ( 36 ) ;
463
+ theme . results . fatal . byFiles [ 'post.hbs' ] . length . should . eql ( 18 ) ;
464
+
465
+ theme . results . error . byFiles [ 'partials/mypartial.hbs' ] . length . should . eql ( 2 ) ;
466
+ theme . results . fatal . byFiles [ 'partials/mypartial.hbs' ] . length . should . eql ( 3 ) ;
467
+
468
+ theme . results . error . byFiles [ 'index.hbs' ] . length . should . eql ( 2 ) ;
469
+ theme . results . fatal . byFiles [ 'index.hbs' ] . length . should . eql ( 7 ) ;
470
+
474
471
theme . results . error . byFiles [ 'error.hbs' ] . length . should . eql ( 1 ) ;
475
472
476
473
done ( ) ;
@@ -481,10 +478,10 @@ describe('format', function () {
481
478
return checker ( themePath ( '001-deprecations/latest/invalid_all' ) ) . then ( ( theme ) => {
482
479
theme = format ( theme , { format : 'cli' } ) ;
483
480
484
- theme . results . error [ 0 ] . rule . should . equal ( 'Replace \u001b[36m{{pageUrl}}\u001b[39m with \u001b[36m{{page_url}}\u001b[39m' ) ;
481
+ theme . results . fatal [ 0 ] . rule . should . equal ( 'Replace \u001b[36m{{pageUrl}}\u001b[39m with \u001b[36m{{page_url}}\u001b[39m' ) ;
485
482
486
- theme . results . error [ 0 ] . details . should . startWith ( `The helper \u001b[36m{{pageUrl}}\u001b[39m was replaced with \u001b[36m{{page_url}}\u001b[39m.\n\n` ) ;
487
- theme . results . error [ 0 ] . details . should . endWith ( `Find more information about the \u001b[36m{{page_url}}\u001b[39m helper <a href="https://themes.ghost.org/docs/page_url" target=_blank>here</a>.` ) ;
483
+ theme . results . fatal [ 0 ] . details . should . startWith ( `The helper \u001b[36m{{pageUrl}}\u001b[39m was replaced with \u001b[36m{{page_url}}\u001b[39m.\n\n` ) ;
484
+ theme . results . fatal [ 0 ] . details . should . endWith ( `Find more information about the \u001b[36m{{page_url}}\u001b[39m helper <a href="https://themes.ghost.org/docs/page_url" target=_blank>here</a>.` ) ;
488
485
} ) ;
489
486
} ) ;
490
487
} ) ;
0 commit comments