|
|
@@ -7,7 +7,7 @@ import { basename, join, resolve } from 'node:path'
|
|
|
import { afterEach, describe, expect, it } from 'vitest'
|
|
|
import { docsPages, landingLink, routeLink, sectionSpec, type DocsPage } from '../website/docs.ts'
|
|
|
import {
|
|
|
- addProjectionFrontmatter, projectedPageContent, publishableImage, rewriteMarkdown,
|
|
|
+ addProjectionFrontmatter, projectedPageContent, publishableImage, resolveRepositoryRef, rewriteMarkdown,
|
|
|
} from './project-doc-site.ts'
|
|
|
|
|
|
const roots: string[] = []
|
|
|
@@ -91,6 +91,16 @@ describe('publishableImage', () => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
+describe('resolveRepositoryRef', () => {
|
|
|
+ it('defaults to public master instead of a private workflow SHA', () => {
|
|
|
+ expect(resolveRepositoryRef({ GITHUB_SHA: 'private-sha' })).toBe('master')
|
|
|
+ })
|
|
|
+
|
|
|
+ it('accepts an explicit public repository ref', () => {
|
|
|
+ expect(resolveRepositoryRef({ DOCS_REPOSITORY_REF: 'public-sha' })).toBe('public-sha')
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
describe('rewriteMarkdown', () => {
|
|
|
it('maps published pages and pins unpublished source links', () => {
|
|
|
const { root, pages } = fixture()
|