feat(TapNodeTools): Add getEnvVarOnDemand method to TapNodeTools

This commit is contained in:
Philipp Kunz 2024-09-19 10:30:14 +02:00
parent 7f765c08e4
commit a551989f8b
3 changed files with 14 additions and 2 deletions

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## 2024-09-19 - 5.3.0 - feat(TapNodeTools)
Add getEnvVarOnDemand method to TapNodeTools
- Introduced a new method getEnvVarOnDemand to the TapNodeTools class to fetch environment variables on demand.
- Enhanced getQenv function in TapNodeTools class to cache the Qenv instance for better performance.
## 2024-09-19 - 5.2.2 - fix(core) ## 2024-09-19 - 5.2.2 - fix(core)
Ensure reliability in test setup and execution Ensure reliability in test setup and execution

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/tapbundle', name: '@push.rocks/tapbundle',
version: '5.2.2', version: '5.3.0',
description: 'A test automation library bundling utilities and tools for TAP (Test Anything Protocol) based testing, specifically tailored for tapbuffer.' description: 'A test automation library bundling utilities and tools for TAP (Test Anything Protocol) based testing, specifically tailored for tapbuffer.'
} }

View File

@ -5,8 +5,14 @@ class TapNodeTools {
constructor() {} constructor() {}
private qenv: plugins.qenv.Qenv;
public async getQenv(): Promise<plugins.qenv.Qenv> { public async getQenv(): Promise<plugins.qenv.Qenv> {
return new plugins.qenv.Qenv('./', '.nogit/'); this.qenv = this.qenv || new plugins.qenv.Qenv('./', '.nogit/');
return this.qenv;
}
public async getEnvVarOnDemand(envVarNameArg: string): Promise<string> {
const qenv = await this.getQenv();
return qenv.getEnvVarOnDemand(envVarNameArg);
} }
public async runCommand(commandArg: string): Promise<any> { public async runCommand(commandArg: string): Promise<any> {