fix(chromium runtime): encode Chromium test bundle names correctly for nested file paths
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-03-26 - 3.6.1 - fix(chromium runtime)
|
||||||
|
encode Chromium test bundle names correctly for nested file paths
|
||||||
|
|
||||||
|
- Use replaceAll() so bundle cache filenames consistently handle test paths with multiple directory separators.
|
||||||
|
- URL-encode the bundleName query parameter before opening the Chromium test page to avoid lookup issues with generated bundle filenames.
|
||||||
|
|
||||||
## 2026-03-24 - 3.6.0 - feat(config)
|
## 2026-03-24 - 3.6.0 - feat(config)
|
||||||
migrate project metadata to .smartconfig and refresh build configuration
|
migrate project metadata to .smartconfig and refresh build configuration
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/tstest',
|
name: '@git.zone/tstest',
|
||||||
version: '3.6.0',
|
version: '3.6.1',
|
||||||
description: 'A powerful, modern test runner for TypeScript with multi-runtime support (Node.js, Deno, Bun, Chromium) and a batteries-included test framework.'
|
description: 'A powerful, modern test runner for TypeScript with multi-runtime support (Node.js, Deno, Bun, Chromium) and a batteries-included test framework.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ export class ChromiumRuntimeAdapter extends RuntimeAdapter {
|
|||||||
|
|
||||||
// lets get all our paths sorted
|
// lets get all our paths sorted
|
||||||
const tsbundleCacheDirPath = plugins.path.join(paths.cwd, './.nogit/tstest_cache');
|
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);
|
const bundleFilePath = plugins.path.join(tsbundleCacheDirPath, bundleFileName);
|
||||||
|
|
||||||
// lets bundle the test
|
// lets bundle the test
|
||||||
@@ -159,7 +159,7 @@ export class ChromiumRuntimeAdapter extends RuntimeAdapter {
|
|||||||
await this.smartbrowserInstance.start();
|
await this.smartbrowserInstance.start();
|
||||||
|
|
||||||
const evaluatePromise = this.smartbrowserInstance.evaluateOnPage(
|
const evaluatePromise = this.smartbrowserInstance.evaluateOnPage(
|
||||||
`http://localhost:${httpPort}/test?bundleName=${bundleFileName}`,
|
`http://localhost:${httpPort}/test?bundleName=${encodeURIComponent(bundleFileName)}`,
|
||||||
async () => {
|
async () => {
|
||||||
// lets enable real time comms
|
// lets enable real time comms
|
||||||
const ws = new WebSocket(`ws://localhost:${globalThis.wsPort}`);
|
const ws = new WebSocket(`ws://localhost:${globalThis.wsPort}`);
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ import '${absoluteTestFile.replace(/\\/g, '/')}';
|
|||||||
|
|
||||||
// lets get all our paths sorted
|
// lets get all our paths sorted
|
||||||
const tsbundleCacheDirPath = plugins.path.join(paths.cwd, './.nogit/tstest_cache');
|
const tsbundleCacheDirPath = plugins.path.join(paths.cwd, './.nogit/tstest_cache');
|
||||||
const bundleFileName = fileNameArg.replace('/', '__') + '.js';
|
const bundleFileName = fileNameArg.replaceAll('/', '__') + '.js';
|
||||||
const bundleFilePath = plugins.path.join(tsbundleCacheDirPath, bundleFileName);
|
const bundleFilePath = plugins.path.join(tsbundleCacheDirPath, bundleFileName);
|
||||||
|
|
||||||
// lets bundle the test
|
// lets bundle the test
|
||||||
@@ -587,7 +587,7 @@ import '${absoluteTestFile.replace(/\\/g, '/')}';
|
|||||||
await this.smartbrowserInstance.start();
|
await this.smartbrowserInstance.start();
|
||||||
|
|
||||||
const evaluatePromise = this.smartbrowserInstance.evaluateOnPage(
|
const evaluatePromise = this.smartbrowserInstance.evaluateOnPage(
|
||||||
`http://localhost:${httpPort}/test?bundleName=${bundleFileName}`,
|
`http://localhost:${httpPort}/test?bundleName=${encodeURIComponent(bundleFileName)}`,
|
||||||
async () => {
|
async () => {
|
||||||
// lets enable real time comms
|
// lets enable real time comms
|
||||||
const ws = new WebSocket(`ws://localhost:${globalThis.wsPort}`);
|
const ws = new WebSocket(`ws://localhost:${globalThis.wsPort}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user