@@ -25,6 +25,7 @@ import allowedVersionOperators from '../../lib/liquid-tags/ifversion-supported-o
25
25
import semver from 'semver'
26
26
import { jest } from '@jest/globals'
27
27
import { getDiffFiles } from '../helpers/diff-files.js'
28
+ import loadSiteData from '../../lib/site-data.js'
28
29
29
30
jest . useFakeTimers ( 'legacy' )
30
31
410
411
411
412
describe ( 'lint markdown content' , ( ) => {
412
413
if ( mdToLint . length < 1 ) return
414
+
415
+ const siteData = loadSiteData ( )
416
+
413
417
describe . each ( mdToLint ) ( '%s' , ( markdownRelPath , markdownAbsPath ) => {
414
418
let content ,
415
419
ast ,
@@ -453,12 +457,14 @@ describe('lint markdown content', () => {
453
457
}
454
458
} )
455
459
460
+ const context = { site : siteData . en . site }
461
+
456
462
// visit is not async-friendly so we need to do an async map to parse the YML snippets
457
463
yamlScheduledWorkflows = (
458
464
await Promise . all (
459
465
yamlScheduledWorkflows . map ( async ( snippet ) => {
460
466
// If we don't parse the Liquid first, yaml loading chokes on {% raw %} tags
461
- const rendered = await renderContent . liquid . parseAndRender ( snippet )
467
+ const rendered = await renderContent . liquid . parseAndRender ( snippet , context )
462
468
const parsed = yaml . load ( rendered )
463
469
return parsed . on . schedule
464
470
} )
@@ -1031,6 +1037,9 @@ describe('lint GHAE release notes', () => {
1031
1037
1032
1038
describe ( 'lint learning tracks' , ( ) => {
1033
1039
if ( learningTracksToLint . length < 1 ) return
1040
+
1041
+ const siteData = loadSiteData ( )
1042
+
1034
1043
describe . each ( learningTracksToLint ) ( '%s' , ( yamlRelPath , yamlAbsPath ) => {
1035
1044
let dictionary
1036
1045
let dictionaryError = false
@@ -1066,7 +1075,7 @@ describe('lint learning tracks', () => {
1066
1075
const productVersions = getApplicableVersions ( data . versions , productTocPath )
1067
1076
1068
1077
const featuredTracks = { }
1069
- const context = { enterpriseServerVersions }
1078
+ const context = { enterpriseServerVersions, site : siteData . en . site }
1070
1079
1071
1080
// For each of the product's versions, render the learning track data and look for a featured track.
1072
1081
await Promise . all (
0 commit comments