digitalocean/test/test.ts

27 lines
793 B
TypeScript
Raw Normal View History

2024-01-24 14:24:53 +00:00
import { expect, tap } from '@push.rocks/tapbundle';
import { Qenv } from '@push.rocks/qenv';
2017-09-17 15:35:01 +00:00
2019-01-05 21:00:02 +00:00
const testQenv = new Qenv('./', './.nogit/');
2017-09-17 15:35:01 +00:00
2024-01-24 14:24:53 +00:00
import * as digitalocean from '../ts/index.js';
2019-01-05 21:00:02 +00:00
let testAccount: digitalocean.DigitalOceanAccount;
let testDroplet: digitalocean.DigitalOceanDroplet;
2024-01-24 14:24:53 +00:00
tap.skip.test('should create a valid account instance', async () => {
2019-01-05 21:00:02 +00:00
testAccount = new digitalocean.DigitalOceanAccount(process.env.DO_API_TOKEN);
2024-01-24 14:24:53 +00:00
expect(testAccount).toBeInstanceOf(digitalocean.DigitalOceanAccount);
2019-01-05 21:00:02 +00:00
});
2024-01-24 14:24:53 +00:00
tap.skip.test('should be able to create a droplet', async () => {
2019-01-05 21:00:02 +00:00
await digitalocean.DigitalOceanDroplet.createDroplet({
account: testAccount,
name: 'mydroplet1',
image: 'ubuntu-18-04-x64',
region: 'fra1',
size: 's-1vcpu-1gb'
});
});
tap.start();