Skip to content

Commit 40d604d

Browse files
authored
Add test to check content files against liquid.parse (#17479)
* Add the test * Don't forget this require
1 parent f71bd97 commit 40d604d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/content/lint-files.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const frontmatter = require('../../lib/frontmatter')
1111
const languages = require('../../lib/languages')
1212
const { tags } = require('../../lib/liquid-tags/extended-markdown')
1313
const ghesReleaseNotesSchema = require('../../lib/release-notes-schema')
14+
const renderContent = require('../../lib/render-content')
1415

1516
const rootDir = path.join(__dirname, '../..')
1617
const contentDir = path.join(rootDir, 'content')
@@ -296,6 +297,15 @@ describe('lint-files', () => {
296297
}
297298
})
298299
})
300+
301+
test('contains valid Liquid', async () => {
302+
// If Liquid can't parse the file, it'll throw an error.
303+
// For example, the following is invalid and will fail this test:
304+
// {% if currentVersion ! "github-ae@latest" %}
305+
await expect(renderContent.liquid.parse(content))
306+
.resolves
307+
.toBeTruthy()
308+
})
299309
}
300310
)
301311

0 commit comments

Comments
 (0)