@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 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
@@ -49,4 +49,4 @@ async function prune() {
49
49
  await exec('docker', ['volume', 'prune']);
50
50
  return '';
51
51
  }
52
- export default { add, list, show, delete: remove, prune };
52
+ export default { add, remove, list, show, prune };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-cli/vm",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Docker volume management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
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.delete({ name: 'test' })).resolves.toEqual('');
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.delete({ name: 'In$%valid' })).rejects.toThrowError('Invalid name');
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.delete({ name: 'failed' })).rejects.toThrowError('Unable to remove volume');
122
+ await expect(vm.remove({ name: 'failed' })).rejects.toThrowError('Unable to remove volume');
123
123
  });
124
124
  });
125
125
 
package/src/index.ts CHANGED
@@ -72,4 +72,4 @@ async function prune() {
72
72
  return '';
73
73
  }
74
74
 
75
- export default { add, list, show, delete: remove, prune };
75
+ export default { add, remove, list, show, prune };