feat(node): Add smartmongo and smarts3 integration in node tools

This commit is contained in:
Philipp Kunz 2024-11-06 02:46:34 +01:00
parent 05a361046e
commit 649e69e1f2
6 changed files with 5339 additions and 4109 deletions

View File

@ -1,5 +1,12 @@
# Changelog
## 2024-11-06 - 5.4.0 - feat(node)
Add smartmongo and smarts3 integration in node tools
- Added createSmartmongo method to TapNodeTools for creating SmartMongo instances.
- Added createSmarts3 method to TapNodeTools for creating Smarts3 instances.
- Updated dependencies with smartmongo and smarts3 in package.json.
## 2024-09-19 - 5.3.0 - feat(TapNodeTools)
Add getEnvVarOnDemand method to TapNodeTools

View File

@ -32,7 +32,9 @@
"@push.rocks/smartenv": "^5.0.12",
"@push.rocks/smartexpect": "^1.2.1",
"@push.rocks/smartjson": "^5.0.20",
"@push.rocks/smartmongo": "^2.0.10",
"@push.rocks/smartpromise": "^4.0.4",
"@push.rocks/smarts3": "^2.2.1",
"@push.rocks/smartshell": "^3.0.6",
"@push.rocks/smarttime": "^4.0.8"
},

9319
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -15,4 +15,14 @@ tap.test('should create a https cert', async () => {
expect(cert).toInclude('-----BEGIN CERTIFICATE-----');
});
tap.test('should create a smartmongo instance', async () => {
const smartmongo = await tapNodeTools.createSmartmongo();
await smartmongo.stop();
});
tap.test('should create a smarts3 instance', async () => {
const smarts3 = await tapNodeTools.createSmarts3();
await smarts3.stop();
});
tap.start();

View File

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

View File

@ -68,6 +68,28 @@ class TapNodeTools {
cert: pemCert,
};
}
/**
* create and return a smartmongo instance
*/
public async createSmartmongo() {
const smartmongoMod = await import('@push.rocks/smartmongo');
const smartmongoInstance = new smartmongoMod.SmartMongo();
await smartmongoInstance.start();
return smartmongoInstance;
}
/**
* create and return a smarts3 instance
*/
public async createSmarts3() {
const smarts3Mod = await import('@push.rocks/smarts3');
const smarts3Instance = new smarts3Mod.Smarts3({
cleanSlate: true,
});
await smarts3Instance.start();
return smarts3Instance;
}
}
export const tapNodeTools = new TapNodeTools();