File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ describe('replacements', () => {
3434 expect ( derivedSettings . settings . locale ) . toEqual ( 'es' ) ;
3535 } ) ;
3636
37+ it ( 'should add skipAudits if using a deployUrl' , ( ) => {
38+ const derivedSettings = getSettings ( { preset : 'desktop' } , true ) ;
39+ expect ( derivedSettings . settings . skipAudits ) . toEqual ( [ 'seo/is-crawlable' ] ) ;
40+ } ) ;
41+
3742 it ( 'should error with incorrect syntax for process.env.SETTINGS' , ( ) => {
3843 process . env . SETTINGS = 'not json' ;
3944 expect ( getSettings ) . toThrow ( / I n v a l i d J S O N / ) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const mergeSettingsSources = (inputSettings = {}) => {
2020 return Object . assign ( { } , envSettings , inputSettings ) ;
2121} ;
2222
23- const getSettings = ( inputSettings ) => {
23+ const getSettings = ( inputSettings , isUsingDeployUrl ) => {
2424 const settings = mergeSettingsSources ( inputSettings ) ;
2525 if ( Object . keys ( settings ) . length === 0 ) return ;
2626
@@ -35,6 +35,12 @@ const getSettings = (inputSettings) => {
3535 derivedSettings . settings . locale = settings . locale ;
3636 }
3737
38+ // If we are running against the Netlify deploy URL, the injected x-robots-tag will always cause the audit to fail,
39+ // likely producing a false positive, so we skip in this case
40+ if ( isUsingDeployUrl ) {
41+ derivedSettings . settings . skipAudits = [ 'seo/is-crawlable' ] ;
42+ }
43+
3844 return derivedSettings ;
3945} ;
4046
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ const runEvent = async ({
4747 let errorMetadata = [ ] ;
4848
4949 try {
50- const settings = getSettings ( inputs ?. settings ) ;
50+ const settings = getSettings ( inputs ?. settings , isOnSuccess ) ;
5151
5252 const allErrors = [ ] ;
5353 const data = [ ] ;
You can’t perform that action at this time.
0 commit comments