2024-09-17 19:40:00 +02:00
|
|
|
import { tap, expect } from '../ts/index.js';
|
|
|
|
|
|
|
|
import { tapNodeTools } from '../ts_node/index.js';
|
|
|
|
|
|
|
|
tap.test('should execure a command', async () => {
|
|
|
|
const result = await tapNodeTools.runCommand('ls -la');
|
|
|
|
expect(result.exitCode).toEqual(0);
|
|
|
|
});
|
|
|
|
|
2024-09-18 00:41:14 +02:00
|
|
|
tap.test('should create a https cert', async () => {
|
|
|
|
const { key, cert } = await tapNodeTools.createHttpsCert('localhost', 'localhost.key', 'localhost.cert');
|
|
|
|
console.log(key);
|
|
|
|
console.log(cert);
|
|
|
|
expect(key).toInclude('-----BEGIN PRIVATE KEY-----');
|
|
|
|
expect(cert).toInclude('-----BEGIN CERTIFICATE-----');
|
|
|
|
});
|
|
|
|
|
2024-09-17 19:40:00 +02:00
|
|
|
tap.start();
|