style: apply prettier formatting from pre-commit hook
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,8 +6,13 @@ import { spawnSync } from 'child_process';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('claw skill script', () => {
|
||||
it('exits zero after successful structured output even if the runtime is terminated', { timeout: 20000 }, () => {
|
||||
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'claw-skill-test-'));
|
||||
it(
|
||||
'exits zero after successful structured output even if the runtime is terminated',
|
||||
{ timeout: 20000 },
|
||||
() => {
|
||||
const tempDir = fs.mkdtempSync(
|
||||
path.join(os.tmpdir(), 'claw-skill-test-'),
|
||||
);
|
||||
const binDir = path.join(tempDir, 'bin');
|
||||
fs.mkdirSync(binDir, { recursive: true });
|
||||
|
||||
@@ -41,5 +46,6 @@ sleep 30
|
||||
expect(result.signal).toBeNull();
|
||||
expect(result.stdout).toContain('4');
|
||||
expect(result.stderr).toContain('[session: sess-1]');
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -51,8 +51,12 @@ describe('stopContainer', () => {
|
||||
});
|
||||
|
||||
it('rejects names with shell metacharacters', () => {
|
||||
expect(() => stopContainer('foo; rm -rf /')).toThrow('Invalid container name');
|
||||
expect(() => stopContainer('foo$(whoami)')).toThrow('Invalid container name');
|
||||
expect(() => stopContainer('foo; rm -rf /')).toThrow(
|
||||
'Invalid container name',
|
||||
);
|
||||
expect(() => stopContainer('foo$(whoami)')).toThrow(
|
||||
'Invalid container name',
|
||||
);
|
||||
expect(() => stopContainer('foo`id`')).toThrow('Invalid container name');
|
||||
expect(mockExecSync).not.toHaveBeenCalled();
|
||||
});
|
||||
@@ -67,13 +71,10 @@ describe('ensureContainerRuntimeRunning', () => {
|
||||
ensureContainerRuntimeRunning();
|
||||
|
||||
expect(mockExecSync).toHaveBeenCalledTimes(1);
|
||||
expect(mockExecSync).toHaveBeenCalledWith(
|
||||
`${CONTAINER_RUNTIME_BIN} info`,
|
||||
{ stdio: 'pipe' },
|
||||
);
|
||||
expect(logger.debug).toHaveBeenCalledWith(
|
||||
'Docker runtime already running',
|
||||
);
|
||||
expect(mockExecSync).toHaveBeenCalledWith(`${CONTAINER_RUNTIME_BIN} info`, {
|
||||
stdio: 'pipe',
|
||||
});
|
||||
expect(logger.debug).toHaveBeenCalledWith('Docker runtime already running');
|
||||
});
|
||||
|
||||
it('throws when docker info fails', () => {
|
||||
|
||||
Reference in New Issue
Block a user