From d1f420445d58309f9ec2b015e54c55079e506644 Mon Sep 17 00:00:00 2001 From: Aileen Booker Date: Wed, 11 Nov 2026 14:50:39 +0400 Subject: [PATCH] Fixed the parse5 version hard-coded in the function-tracing test `function-tracing.acceptance.test.mjs` asserted the literal pnpm store path `node_modules/.pnpm/parse5@8.0.1/...` inside the packaged function archive, so every Renovate bump of parse5 failed CI even though the tracing itself worked. The expected path is now derived at test time by resolving parse5 from the extractor package, which keeps asserting that the exact installed parse5 build is traced into the archive while following whatever version the lockfile carries. On the current lockfile the derived path is byte-identical to the removed literal, so the assertion's strength is unchanged. --- .../test/function-tracing.acceptance.test.mjs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/algolia-netlify/test/function-tracing.acceptance.test.mjs b/packages/algolia-netlify/test/function-tracing.acceptance.test.mjs index befb088d..17518375 100644 --- a/packages/algolia-netlify/test/function-tracing.acceptance.test.mjs +++ b/packages/algolia-netlify/test/function-tracing.acceptance.test.mjs @@ -1,5 +1,6 @@ import {execFile} from 'node:child_process'; import {readFile, rm} from 'node:fs/promises'; +import {createRequire} from 'node:module'; import path from 'node:path'; import {promisify} from 'node:util'; import {fileURLToPath} from 'node:url'; @@ -17,6 +18,15 @@ const extractorDistDirectory = path.resolve( // The workspace root has no netlify binary; resolve the pinned CLI from this package so the // test does not depend on a globally installed netlify-cli. const netlifyBinary = path.join(packageDirectory, 'node_modules/.bin/netlify'); +// Resolve parse5 the way the extractor does, so the expected archive path tracks +// the installed version instead of hard-coding one. +const extractorRequire = createRequire( + path.join(workspaceDirectory, 'packages/algolia-html-extractor/package.json') +); +const parse5ArchivePath = path + .relative(workspaceDirectory, extractorRequire.resolve('parse5')) + .split(path.sep) + .join('/'); describe('Netlify function dependency tracing', () => { beforeEach(async () => { @@ -36,9 +46,7 @@ describe('Netlify function dependency tracing', () => { expect(archiveIndex).toContain('packages/algolia-fragmenter/lib/index.mjs'); expect(archiveIndex).toContain('packages/algolia-html-extractor/dist/index.mjs'); - expect(archiveIndex).toContain( - 'node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/index.js' - ); + expect(archiveIndex).toContain(parse5ArchivePath); expect(archiveIndex).not.toContain('algolia-html-extractor@0.0.1'); expect(archiveIndex).not.toContain(workspaceDirectory); }