bobcat/test/test.ts

35 lines
998 B
TypeScript
Raw Permalink Normal View History

2022-02-24 19:16:21 +00:00
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
2022-02-25 19:36:44 +00:00
import { Qenv } from '@pushrocks/qenv';
const testQenv = new Qenv('./', './.nogit');
2022-02-24 19:16:21 +00:00
import * as bobcat from '../ts/index';
let testBobcatManager: bobcat.BobcatManager;
let testBobcat: bobcat.Bobcat;
2022-02-25 20:35:34 +00:00
tap.test('should create a bobcat manager', async () => {
2022-02-24 19:16:21 +00:00
testBobcatManager = new bobcat.BobcatManager();
expect(testBobcatManager).toBeInstanceOf(bobcat.BobcatManager);
});
2022-02-25 20:35:34 +00:00
tap.test('should create a bobcat', async () => {
testBobcat = new bobcat.Bobcat('bobcat.bleu.de');
expect(testBobcat).toBeInstanceOf(bobcat.Bobcat);
})
2022-02-25 19:36:44 +00:00
tap.test('should add a Bobcat miner', async () => {
const bobcatAddresses = testQenv.getEnvVarOnDemand('BOBCATS').split(',');
console.log(bobcatAddresses);
for (const bobcatAddress of bobcatAddresses) {
await testBobcatManager.addBobcat(bobcatAddress);
}
});
2022-02-25 20:35:34 +00:00
tap.test('should run maintenance on bobcats', async () => {
await testBobcatManager.runMaintenance();
2022-02-24 19:16:21 +00:00
})
tap.start();