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', () => {
34
34
expect ( derivedSettings . settings . locale ) . toEqual ( 'es' ) ;
35
35
} ) ;
36
36
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
+
37
42
it ( 'should error with incorrect syntax for process.env.SETTINGS' , ( ) => {
38
43
process . env . SETTINGS = 'not json' ;
39
44
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 = {}) => {
20
20
return Object . assign ( { } , envSettings , inputSettings ) ;
21
21
} ;
22
22
23
- const getSettings = ( inputSettings ) => {
23
+ const getSettings = ( inputSettings , isUsingDeployUrl ) => {
24
24
const settings = mergeSettingsSources ( inputSettings ) ;
25
25
if ( Object . keys ( settings ) . length === 0 ) return ;
26
26
@@ -35,6 +35,12 @@ const getSettings = (inputSettings) => {
35
35
derivedSettings . settings . locale = settings . locale ;
36
36
}
37
37
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
+
38
44
return derivedSettings ;
39
45
} ;
40
46
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ const runEvent = async ({
47
47
let errorMetadata = [ ] ;
48
48
49
49
try {
50
- const settings = getSettings ( inputs ?. settings ) ;
50
+ const settings = getSettings ( inputs ?. settings , isOnSuccess ) ;
51
51
52
52
const allErrors = [ ] ;
53
53
const data = [ ] ;
You can’t perform that action at this time.
0 commit comments