forked from Chatham/node-cloudstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCS.test.js
More file actions
35 lines (31 loc) · 892 Bytes
/
CS.test.js
File metadata and controls
35 lines (31 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require('dotenv').config()
const cloudstack = require('./lib/cloudstack.js');
client = new cloudstack({
apiUri: process.env.CLOUDSTACK_API_URI,
apiKey: process.env.CLOUDSTACK_API_KEY,
apiSecret: process.env.CLOUDSTACK_API_SECRET,
});
describe('Zone functions', () => {
test('listZones', done => {
client.exec('listZones', {}, (result) => {
expect(result.zone).toBeDefined()
done();
})
})
})
describe('List functions', () => {
test('listVirtualMachines', done => {
client.exec('listVirtualMachines', {}, (result => {
expect(result.virtualmachine).toBeDefined();
done();
}))
})
})
describe('List functions (fetch_list)', () => {
test('listVirtualMachines', done => {
client.exec('listVirtualMachines', {fetch_list: true}, (result => {
expect(result.virtualmachine.length).toEqual(result.count);
done();
}))
})
})