@cloud-cli/vm 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/index.spec.ts +3 -3
- package/src/index.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ declare function remove(options: NameOption): Promise<string>;
|
|
|
12
12
|
declare function prune(): Promise<string>;
|
|
13
13
|
declare const _default: {
|
|
14
14
|
add: typeof add;
|
|
15
|
+
remove: typeof remove;
|
|
15
16
|
list: typeof list;
|
|
16
17
|
show: typeof show;
|
|
17
|
-
delete: typeof remove;
|
|
18
18
|
prune: typeof prune;
|
|
19
19
|
};
|
|
20
20
|
export default _default;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
package/src/index.spec.ts
CHANGED
|
@@ -104,14 +104,14 @@ describe('volume manager', () => {
|
|
|
104
104
|
const execOutput = { ok: true, stdout: '' };
|
|
105
105
|
execMocks.exec = jest.fn().mockResolvedValue(execOutput);
|
|
106
106
|
|
|
107
|
-
await expect(vm.
|
|
107
|
+
await expect(vm.remove({ name: 'test' })).resolves.toEqual('');
|
|
108
108
|
|
|
109
109
|
expect(exec.exec).toHaveBeenCalledWith('docker', ['volume', 'rm', 'test']);
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
it('should throw error if volume name is invalid', async () => {
|
|
113
113
|
execMocks.exec = jest.fn();
|
|
114
|
-
await expect(vm.
|
|
114
|
+
await expect(vm.remove({ name: 'In$%valid' })).rejects.toThrowError('Invalid name');
|
|
115
115
|
expect(exec.exec).not.toHaveBeenCalled();
|
|
116
116
|
});
|
|
117
117
|
|
|
@@ -119,7 +119,7 @@ describe('volume manager', () => {
|
|
|
119
119
|
const output = { ok: false, stdout: '' };
|
|
120
120
|
execMocks.exec = jest.fn().mockResolvedValue(output);
|
|
121
121
|
|
|
122
|
-
await expect(vm.
|
|
122
|
+
await expect(vm.remove({ name: 'failed' })).rejects.toThrowError('Unable to remove volume');
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
|
package/src/index.ts
CHANGED