зеркало из https://github.com/github/docs.git
add a new test to validate versions FM in fixture
This commit is contained in:
Родитель
092de5186e
Коммит
ebbc664578
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
title: This is an article
|
||||
intro: I am missing productVersions frontmatter
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghae: 'issue-foo' # Only issue-<number> is allowed, per lib/all-versions.js
|
||||
---
|
|
@ -794,6 +794,18 @@ describe('catches errors thrown in Page class', () => {
|
|||
await expect(getPage).rejects.toThrowError('versions')
|
||||
})
|
||||
|
||||
test('invalid versions frontmatter', async () => {
|
||||
async function getPage() {
|
||||
return await Page.init({
|
||||
relativePath: 'page-with-invalid-product-version.md',
|
||||
basePath: path.join(__dirname, '../fixtures'),
|
||||
languageCode: 'en',
|
||||
})
|
||||
}
|
||||
|
||||
await expect(getPage).rejects.toThrowError('versions')
|
||||
})
|
||||
|
||||
test('English page with a version in frontmatter that its parent product is not available in', async () => {
|
||||
async function getPage() {
|
||||
return await Page.init({
|
||||
|
|
Загрузка…
Ссылка в новой задаче