Skip to main content
Glama
deleonio
by deleonio
remove-task.spec.ts873 B
import fs from 'fs'; import assert from 'node:assert'; import os from 'os'; import path from 'path'; import { RemoveTask } from '../src/migrate/runner/tasks/common/RemoveTask'; describe('RemoveTask', () => { it('executes rimraf command', async () => { const childProc = require('child_process'); const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'kolibri-cli-')); const filePath = path.join(tmpDir, 'to-remove.txt'); fs.writeFileSync(filePath, 'data'); const original = childProc.execSync; let executed = ''; (childProc as any).execSync = (cmd: string) => { executed = cmd; fs.rmSync(filePath, { force: true }); return Buffer.from(''); }; const task = RemoveTask.getInstance(filePath, '^1'); task.run(); (childProc as any).execSync = original; assert.ok(!fs.existsSync(filePath)); assert.ok(executed.includes('rimraf')); }); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/deleonio/public-ui-kolibri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server