@quatrain/worker 1.2.4 → 1.2.5
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/Worker.test.js +4 -1
- package/package.json +3 -3
- package/src/Worker.test.ts +4 -1
package/dist/Worker.test.js
CHANGED
|
@@ -8,7 +8,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
8
8
|
const node_child_process_1 = require("node:child_process");
|
|
9
9
|
// Mock dependencies
|
|
10
10
|
jest.mock('axios');
|
|
11
|
-
jest.mock('child_process');
|
|
11
|
+
jest.mock('node:child_process');
|
|
12
12
|
const mockedAxios = axios_1.default;
|
|
13
13
|
const mockedSpawn = node_child_process_1.spawn;
|
|
14
14
|
describe('Worker', () => {
|
|
@@ -153,6 +153,7 @@ describe('Worker', () => {
|
|
|
153
153
|
await expect(Worker_1.Worker.execPromise('ls', ['-la'], '/tmp')).resolves.toBeUndefined();
|
|
154
154
|
expect(mockedSpawn).toHaveBeenCalledWith('ls', ['-la'], {
|
|
155
155
|
cwd: '/tmp',
|
|
156
|
+
shell: false,
|
|
156
157
|
});
|
|
157
158
|
});
|
|
158
159
|
it('should reject on command failure', async () => {
|
|
@@ -191,6 +192,7 @@ describe('Worker', () => {
|
|
|
191
192
|
await Worker_1.Worker.execPromise('echo', ['test']);
|
|
192
193
|
expect(mockedSpawn).toHaveBeenCalledWith('echo', ['test'], {
|
|
193
194
|
cwd: process.cwd(),
|
|
195
|
+
shell: false,
|
|
194
196
|
});
|
|
195
197
|
});
|
|
196
198
|
it('should pass arguments to command', async () => {
|
|
@@ -208,6 +210,7 @@ describe('Worker', () => {
|
|
|
208
210
|
await Worker_1.Worker.execPromise('command', args, '/custom/path');
|
|
209
211
|
expect(mockedSpawn).toHaveBeenCalledWith('command', args, {
|
|
210
212
|
cwd: '/custom/path',
|
|
213
|
+
shell: false,
|
|
211
214
|
});
|
|
212
215
|
});
|
|
213
216
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/worker",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "Container Worker helpers",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"typescript": "^5.1.5"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@quatrain/core": "^1.2.
|
|
37
|
+
"@quatrain/core": "^1.2.9",
|
|
38
38
|
"@quatrain/queue": "^1.2.3",
|
|
39
|
-
"@quatrain/storage": "^1.2.
|
|
39
|
+
"@quatrain/storage": "^1.2.8",
|
|
40
40
|
"axios": "^1.7.7",
|
|
41
41
|
"fluent-ffmpeg": "^2.1.2",
|
|
42
42
|
"fs-extra": "^11.2.0",
|
package/src/Worker.test.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { spawn } from 'node:child_process'
|
|
|
4
4
|
|
|
5
5
|
// Mock dependencies
|
|
6
6
|
jest.mock('axios')
|
|
7
|
-
jest.mock('child_process')
|
|
7
|
+
jest.mock('node:child_process')
|
|
8
8
|
|
|
9
9
|
const mockedAxios = axios as jest.Mocked<typeof axios>
|
|
10
10
|
const mockedSpawn = spawn as jest.MockedFunction<typeof spawn>
|
|
@@ -209,6 +209,7 @@ describe('Worker', () => {
|
|
|
209
209
|
|
|
210
210
|
expect(mockedSpawn).toHaveBeenCalledWith('ls', ['-la'], {
|
|
211
211
|
cwd: '/tmp',
|
|
212
|
+
shell: false,
|
|
212
213
|
})
|
|
213
214
|
})
|
|
214
215
|
|
|
@@ -256,6 +257,7 @@ describe('Worker', () => {
|
|
|
256
257
|
|
|
257
258
|
expect(mockedSpawn).toHaveBeenCalledWith('echo', ['test'], {
|
|
258
259
|
cwd: process.cwd(),
|
|
260
|
+
shell: false,
|
|
259
261
|
})
|
|
260
262
|
})
|
|
261
263
|
|
|
@@ -277,6 +279,7 @@ describe('Worker', () => {
|
|
|
277
279
|
|
|
278
280
|
expect(mockedSpawn).toHaveBeenCalledWith('command', args, {
|
|
279
281
|
cwd: '/custom/path',
|
|
282
|
+
shell: false,
|
|
280
283
|
})
|
|
281
284
|
})
|
|
282
285
|
})
|