@@ -345,7 +345,6 @@ describe('lint markdown content', () => {
345
345
let content ,
346
346
ast ,
347
347
links ,
348
- yamlScheduledWorkflows ,
349
348
isHidden ,
350
349
isEarlyAccess ,
351
350
isSitePolicy ,
@@ -377,40 +376,6 @@ describe('lint markdown content', () => {
377
376
visit ( ast , [ 'link' , 'definition' ] , ( node ) => {
378
377
links . push ( node . url )
379
378
} )
380
-
381
- yamlScheduledWorkflows = [ ]
382
- visit ( ast , 'code' , ( node ) => {
383
- if (
384
- / y a ? m l / . test ( node . lang ) &&
385
- node . value . includes ( 'schedule:' ) &&
386
- node . value . includes ( 'cron:' )
387
- ) {
388
- yamlScheduledWorkflows . push ( node . value )
389
- }
390
- } )
391
-
392
- const context = {
393
- currentLanguage : 'en' ,
394
- // Any Liquid that might use our `ifversion` plugin requires and
395
- // expects that there's a `currentVersionObj` object present in the
396
- // environment.
397
- currentVersionObj : { } ,
398
- }
399
-
400
- // visit is not async-friendly so we need to do an async map to parse the YML snippets
401
- yamlScheduledWorkflows = (
402
- await Promise . all (
403
- yamlScheduledWorkflows . map ( async ( snippet ) => {
404
- // If we don't parse the Liquid first, yaml loading chokes on {% raw %} tags
405
- const rendered = await liquid . parseAndRender ( snippet , context )
406
- const parsed = yaml . load ( rendered )
407
- if ( ! parsed ?. on ?. schedule ?. cron ) return [ ]
408
- return parsed . on . schedule
409
- } ) ,
410
- )
411
- )
412
- . flat ( )
413
- . map ( ( schedule ) => schedule . cron )
414
379
} )
415
380
416
381
test ( 'placeholder string is not present in any markdown files' , async ( ) => {
@@ -481,20 +446,6 @@ describe('lint markdown content', () => {
481
446
expect ( matches . length , errorMessage ) . toBe ( 0 )
482
447
} )
483
448
484
- test ( 'yaml snippets that include scheduled workflows must not run on the hour' , async ( ) => {
485
- const hourlySchedules = yamlScheduledWorkflows . filter ( ( schedule ) => {
486
- const hour = schedule . split ( ' ' ) [ 0 ]
487
- // return any minute cron segments that equal 0, 00, 000, etc.
488
- return ! / [ ^ 0 ] / . test ( hour )
489
- } )
490
- expect ( hourlySchedules ) . toEqual ( [ ] )
491
- } )
492
-
493
- // Note this only ensures that scheduled workflow snippets are unique _per Markdown file_
494
- test ( 'yaml snippets that include scheduled workflows run at unique times' , ( ) => {
495
- expect ( yamlScheduledWorkflows . length ) . toEqual ( new Set ( yamlScheduledWorkflows ) . size )
496
- } )
497
-
498
449
test ( 'must not leak Early Access doc URLs' , async ( ) => {
499
450
// Only execute for docs that are NOT Early Access
500
451
if ( ! isEarlyAccess ) {
0 commit comments