@@ -620,7 +620,7 @@ describe('Config', () => {
620
620
const saveWarning = evt => warnings . push ( evt ) ;
621
621
log . events . addListener ( 'warning' , saveWarning ) ;
622
622
const config = new Config ( {
623
- extends : true ,
623
+ extends : 'lighthouse:default' ,
624
624
settings : {
625
625
onlyCategories : [ 'accessibility' ] ,
626
626
} ,
@@ -638,7 +638,7 @@ describe('Config', () => {
638
638
const saveWarning = evt => warnings . push ( evt ) ;
639
639
log . events . addListener ( 'warning' , saveWarning ) ;
640
640
const config = new Config ( {
641
- extends : true ,
641
+ extends : 'lighthouse:default' ,
642
642
settings : {
643
643
onlyCategories : [ 'performance' , 'pwa' ] ,
644
644
} ,
@@ -655,7 +655,7 @@ describe('Config', () => {
655
655
656
656
it ( 'filters works with extension' , ( ) => {
657
657
const config = new Config ( {
658
- extends : true ,
658
+ extends : 'lighthouse:default' ,
659
659
settings : {
660
660
onlyCategories : [ 'performance' ] ,
661
661
onlyAudits : [ 'is-on-https' ] ,
@@ -672,7 +672,7 @@ describe('Config', () => {
672
672
const saveWarning = evt => warnings . push ( evt ) ;
673
673
log . events . addListener ( 'warning' , saveWarning ) ;
674
674
const config = new Config ( {
675
- extends : true ,
675
+ extends : 'lighthouse:default' ,
676
676
settings : {
677
677
onlyCategories : [ 'performance' , 'missing-category' ] ,
678
678
onlyAudits : [ 'first-cpu-idle' , 'missing-audit' ] ,
@@ -687,7 +687,7 @@ describe('Config', () => {
687
687
it ( 'throws for invalid use of skipAudits and onlyAudits' , ( ) => {
688
688
assert . throws ( ( ) => {
689
689
new Config ( {
690
- extends : true ,
690
+ extends : 'lighthouse:default' ,
691
691
settings : {
692
692
onlyAudits : [ 'first-meaningful-paint' ] ,
693
693
skipAudits : [ 'first-meaningful-paint' ] ,
@@ -697,22 +697,17 @@ describe('Config', () => {
697
697
} ) ;
698
698
699
699
it ( 'cleans up flags for settings' , ( ) => {
700
- const config = new Config ( { extends : true } , { nonsense : 1 , foo : 2 , throttlingMethod : 'provided' } ) ;
700
+ const config = new Config ( { extends : 'lighthouse:default' } ,
701
+ { nonsense : 1 , foo : 2 , throttlingMethod : 'provided' } ) ;
701
702
assert . equal ( config . settings . throttlingMethod , 'provided' ) ;
702
703
assert . ok ( config . settings . nonsense === undefined , 'did not cleanup settings' ) ;
703
704
} ) ;
704
705
705
706
it ( 'allows overriding of array-typed settings' , ( ) => {
706
- const config = new Config ( { extends : true } , { output : [ 'html' ] } ) ;
707
+ const config = new Config ( { extends : 'lighthouse:default' } , { output : [ 'html' ] } ) ;
707
708
assert . deepStrictEqual ( config . settings . output , [ 'html' ] ) ;
708
709
} ) ;
709
710
710
- it ( 'does not throw on "lighthouse:full"' , ( ) => {
711
- const config = new Config ( { extends : 'lighthouse:full' } , { output : [ 'html' , 'json' ] } ) ;
712
- assert . deepStrictEqual ( config . settings . throttlingMethod , 'simulate' ) ;
713
- assert . deepStrictEqual ( config . settings . output , [ 'html' , 'json' ] ) ;
714
- } ) ;
715
-
716
711
it ( 'extends the config' , ( ) => {
717
712
class CustomAudit extends Audit {
718
713
static get meta ( ) {
@@ -783,6 +778,14 @@ describe('Config', () => {
783
778
assert . equal ( config . passes [ 0 ] . networkQuietThresholdMs , 10003 ) ;
784
779
} ) ;
785
780
781
+ it ( 'only supports `lighthouse:default` extension' , ( ) => {
782
+ const createConfig = extendsValue => new Config ( { extends : extendsValue } ) ;
783
+
784
+ expect ( ( ) => createConfig ( true ) ) . toThrowError ( / d e f a u l t ` i s t h e o n l y v a l i d e x t e n s i o n / ) ;
785
+ expect ( ( ) => createConfig ( 'lighthouse' ) ) . toThrowError ( / d e f a u l t ` i s t h e o n l y v a l i d / ) ;
786
+ expect ( ( ) => createConfig ( 'lighthouse:full' ) ) . toThrowError ( / d e f a u l t ` i s t h e o n l y v a l i d / ) ;
787
+ } ) ;
788
+
786
789
it ( 'merges settings with correct priority' , ( ) => {
787
790
const config = new Config (
788
791
{
@@ -897,9 +900,9 @@ describe('Config', () => {
897
900
devtoolsLogs : { defaultPass : 'path/to/devtools/log' } ,
898
901
} ;
899
902
const configA = { } ;
900
- const configB = { extends : true , artifacts} ;
903
+ const configB = { extends : 'lighthouse:default' , artifacts} ;
901
904
const merged = Config . extendConfigJSON ( configA , configB ) ;
902
- assert . equal ( merged . extends , true ) ;
905
+ assert . equal ( merged . extends , 'lighthouse:default' ) ;
903
906
assert . equal ( merged . artifacts , configB . artifacts ) ;
904
907
} ) ;
905
908
} ) ;
0 commit comments