qa: add e2e tests

This commit is contained in:
Morten Olsen
2024-01-17 00:16:21 +01:00
parent e5064ca905
commit d3ad83ddf7
68 changed files with 1560 additions and 583 deletions

View File

@@ -0,0 +1,27 @@
import ora from 'ora';
import { Service } from 'typedi';
@Service()
class Terminal {
public log = (message: string) => {
console.log(message);
};
public output = (data: unknown) => {
console.table(data);
};
public step = async <T>(message: string, action: () => Promise<T>) => {
const spinner = ora(message).start();
try {
const result = await action();
await spinner.succeed();
return result;
} catch (err) {
await spinner.fail();
throw err;
}
};
}
export { Terminal };