|
|
|
@ -1,10 +1,13 @@
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
|
|
|
|
createTitle,
|
|
|
|
isRelativeBase,
|
|
|
|
isRelativeBase,
|
|
|
|
joinPath,
|
|
|
|
joinPath,
|
|
|
|
mergeHead,
|
|
|
|
mergeHead,
|
|
|
|
pageChunkPath,
|
|
|
|
pageChunkPath,
|
|
|
|
relativePathToRoot,
|
|
|
|
relativePathToRoot,
|
|
|
|
type HeadConfig
|
|
|
|
type HeadConfig,
|
|
|
|
|
|
|
|
type PageData,
|
|
|
|
|
|
|
|
type SiteData
|
|
|
|
} from 'shared/shared'
|
|
|
|
} from 'shared/shared'
|
|
|
|
|
|
|
|
|
|
|
|
describe('shared/shared', () => {
|
|
|
|
describe('shared/shared', () => {
|
|
|
|
@ -25,6 +28,16 @@ describe('shared/shared', () => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('createTitle', () => {
|
|
|
|
|
|
|
|
test('inserts titles containing $ literally into :title templates', () => {
|
|
|
|
|
|
|
|
const site = { title: 'Site', titleTemplate: ':title - Docs' }
|
|
|
|
|
|
|
|
const page = { title: 'Using $& and $$ in Bash' }
|
|
|
|
|
|
|
|
expect(createTitle(site as SiteData, page as PageData)).toBe(
|
|
|
|
|
|
|
|
'Using $& and $$ in Bash - Docs'
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
describe('mergeHead', () => {
|
|
|
|
describe('mergeHead', () => {
|
|
|
|
test('replaces meta tags with the same key in place', () => {
|
|
|
|
test('replaces meta tags with the same key in place', () => {
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
|
|