feat(runtime-adapters): Enable TypeScript decorator support for Deno and Bun runtimes and add decorator tests
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tstest',
|
||||
version: '2.7.0',
|
||||
version: '2.8.0',
|
||||
description: 'a test utility to run tests that match test/**/*.ts'
|
||||
}
|
||||
|
||||
@@ -69,6 +69,9 @@ export class BunRuntimeAdapter extends RuntimeAdapter {
|
||||
|
||||
const args: string[] = ['run'];
|
||||
|
||||
// Note: Bun automatically discovers bunfig.toml in the current directory
|
||||
// This ensures TypeScript decorator support is enabled if bunfig.toml is present
|
||||
|
||||
// Add extra args
|
||||
if (mergedOptions.extraArgs && mergedOptions.extraArgs.length > 0) {
|
||||
args.push(...mergedOptions.extraArgs);
|
||||
|
||||
@@ -31,8 +31,20 @@ export class DenoRuntimeAdapter extends RuntimeAdapter {
|
||||
* Get default Deno options
|
||||
*/
|
||||
protected getDefaultOptions(): DenoOptions {
|
||||
// Auto-detect deno.json or deno.jsonc config file for TypeScript decorator support
|
||||
let configPath: string | undefined;
|
||||
const denoJsonPath = plugins.path.join(process.cwd(), 'deno.json');
|
||||
const denoJsoncPath = plugins.path.join(process.cwd(), 'deno.jsonc');
|
||||
|
||||
if (plugins.smartfile.fs.fileExistsSync(denoJsonPath)) {
|
||||
configPath = denoJsonPath;
|
||||
} else if (plugins.smartfile.fs.fileExistsSync(denoJsoncPath)) {
|
||||
configPath = denoJsoncPath;
|
||||
}
|
||||
|
||||
return {
|
||||
...super.getDefaultOptions(),
|
||||
configPath,
|
||||
permissions: [
|
||||
'--allow-read',
|
||||
'--allow-env',
|
||||
|
||||
Reference in New Issue
Block a user