@@ -2,7 +2,7 @@ import assert from "node:assert/strict"
22import { readdir , readFile } from "node:fs/promises"
33import test from "node:test"
44import { parse } from "yaml"
5- import { getSiteUrl } from "../src/config/site.ts"
5+ import { getSiteUrl } from "../../../ src/config/site.ts"
66
77const expectedSiteUrl = getSiteUrl ( )
88
@@ -20,7 +20,7 @@ const getMetaContent = (html: string, attribute: string, value: string) => {
2020}
2121
2222test ( "all posts make an explicit social preview image decision" , async ( ) => {
23- const postsDirectory = new URL ( "../src/content/posts/" , import . meta. url )
23+ const postsDirectory = new URL ( "../../../ src/content/posts/" , import . meta. url )
2424 const filenames = await readdir ( postsDirectory )
2525
2626 for ( const filename of filenames . filter ( ( name ) => name . endsWith ( ".mdx" ) ) ) {
@@ -37,7 +37,7 @@ test("all posts make an explicit social preview image decision", async () => {
3737
3838test ( "article pages expose description metadata for link previews" , async ( ) => {
3939 const html = await readPage (
40- "../dist/posts/hands-on-home-row-for-ai-assisted-coding/index.html" ,
40+ "../../../ dist/posts/hands-on-home-row-for-ai-assisted-coding/index.html" ,
4141 )
4242 const description =
4343 "AI-assisted coding has fit surprisingly well with the terminal and text-first tools I spent years sharpening. Agent orchestration may be the industry productivity boost I long wanted. While engineering discipline still matters, I feel wistful for hands-on coding."
@@ -77,7 +77,7 @@ test("image-backed articles expose absolute social preview images and alt text",
7777 ]
7878
7979 for ( const { alt, file, slug } of cases ) {
80- const html = await readPage ( `../dist/posts/${ slug } /index.html` )
80+ const html = await readPage ( `../../../ dist/posts/${ slug } /index.html` )
8181 const [ name , extension ] = file . split ( "." )
8282 const imageUrl = getMetaContent ( html , "property" , "og:image" )
8383
@@ -88,7 +88,9 @@ test("image-backed articles expose absolute social preview images and alt text",
8888} )
8989
9090test ( "articles without a preview image use the large social image fallback" , async ( ) => {
91- const html = await readPage ( "../dist/posts/avoid-git-first-drafts/index.html" )
91+ const html = await readPage (
92+ "../../../dist/posts/avoid-git-first-drafts/index.html" ,
93+ )
9294
9395 assert . equal (
9496 getMetaContent ( html , "property" , "og:image" ) ,
@@ -103,7 +105,7 @@ test("articles without a preview image use the large social image fallback", asy
103105} )
104106
105107test ( "post pages identify themselves as Open Graph articles" , async ( ) => {
106- const html = await readPage ( "../dist/posts/paint-by-types/index.html" )
108+ const html = await readPage ( "../../../ dist/posts/paint-by-types/index.html" )
107109
108110 assert . equal ( getMetaContent ( html , "property" , "og:type" ) , "article" )
109111} )
0 commit comments