fix(chromium runtime): encode Chromium test bundle names correctly for nested file paths

This commit is contained in:
2026-03-26 08:19:42 +00:00
parent 8435c45b4b
commit 3a56040c5b
4 changed files with 11 additions and 5 deletions

View File

@@ -103,7 +103,7 @@ export class ChromiumRuntimeAdapter extends RuntimeAdapter {
// lets get all our paths sorted
const tsbundleCacheDirPath = plugins.path.join(paths.cwd, './.nogit/tstest_cache');
const bundleFileName = testFile.replace('/', '__') + '.js';
const bundleFileName = testFile.replaceAll('/', '__') + '.js';
const bundleFilePath = plugins.path.join(tsbundleCacheDirPath, bundleFileName);
// lets bundle the test
@@ -159,7 +159,7 @@ export class ChromiumRuntimeAdapter extends RuntimeAdapter {
await this.smartbrowserInstance.start();
const evaluatePromise = this.smartbrowserInstance.evaluateOnPage(
`http://localhost:${httpPort}/test?bundleName=${bundleFileName}`,
`http://localhost:${httpPort}/test?bundleName=${encodeURIComponent(bundleFileName)}`,
async () => {
// lets enable real time comms
const ws = new WebSocket(`ws://localhost:${globalThis.wsPort}`);