test(e2e): add basic integration test
This commit is contained in:
parent
abab656969
commit
1197d85fdc
23
tests/e2e.test.ts
Normal file
23
tests/e2e.test.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
||||
import { mkdtempSync, rmSync, existsSync } from 'fs';
|
||||
import { tmpdir } from 'os';
|
||||
import { join } from 'path';
|
||||
import { execSync } from 'child_process';
|
||||
|
||||
describe('e2e', () => {
|
||||
let cwd: string;
|
||||
|
||||
beforeEach(() => {
|
||||
cwd = mkdtempSync(join(tmpdir(), 'agenthub-e2e-'));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
rmSync(cwd, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
it('initializes and creates a task', () => {
|
||||
const bin = join(process.cwd(), 'bin', 'agenthub.js');
|
||||
execSync(`node ${bin} init --yes --project-name e2e-test`, { cwd });
|
||||
expect(existsSync(join(cwd, '.agenthub', 'agenthub.config.json'))).toBe(true);
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user