mirror of https://github.com/buster-so/buster.git
clean up builds and errors
This commit is contained in:
parent
1e021f4da1
commit
82d89cf702
|
@ -1,11 +1,23 @@
|
|||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
import { createCheckOffTodoListTool } from './check-off-todo-list-tool';
|
||||
import type {
|
||||
CheckOffTodoListToolInput,
|
||||
CheckOffTodoListToolOutput,
|
||||
} from './check-off-todo-list-tool';
|
||||
|
||||
describe('checkOffTodoList', () => {
|
||||
let checkOffTodoListTool: ReturnType<typeof createCheckOffTodoListTool>;
|
||||
let todoList: string;
|
||||
let updateTodoListCalled: boolean;
|
||||
|
||||
// Helper to call execute with a concrete signature
|
||||
const run = async (input: CheckOffTodoListToolInput): Promise<CheckOffTodoListToolOutput> => {
|
||||
const exec = checkOffTodoListTool.execute as (
|
||||
i: CheckOffTodoListToolInput
|
||||
) => Promise<CheckOffTodoListToolOutput>;
|
||||
return exec(input);
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
todoList = '';
|
||||
updateTodoListCalled = false;
|
||||
|
@ -26,7 +38,7 @@ describe('checkOffTodoList', () => {
|
|||
- [ ] Implement feature
|
||||
- [ ] Review code`;
|
||||
|
||||
const result = await checkOffTodoListTool.execute({
|
||||
const result = await run({
|
||||
todoItems: ['Write unit tests'],
|
||||
});
|
||||
|
||||
|
@ -50,7 +62,7 @@ describe('checkOffTodoList', () => {
|
|||
- [ ] Review code
|
||||
- [ ] Deploy to production`;
|
||||
|
||||
const result = await checkOffTodoListTool.execute({
|
||||
const result = await run({
|
||||
todoItems: ['Write unit tests', 'Review code'],
|
||||
});
|
||||
|
||||
|
@ -70,7 +82,7 @@ describe('checkOffTodoList', () => {
|
|||
- [ ] Implement feature
|
||||
- [ ] Review code`;
|
||||
|
||||
const result = await checkOffTodoListTool.execute({
|
||||
const result = await run({
|
||||
todoItems: ['Write unit tests', 'Non-existent task', 'Review code'],
|
||||
});
|
||||
|
||||
|
@ -86,7 +98,7 @@ describe('checkOffTodoList', () => {
|
|||
it('should return error when todo list is not found in context', async () => {
|
||||
todoList = '';
|
||||
|
||||
const result = await checkOffTodoListTool.execute({
|
||||
const result = await run({
|
||||
todoItems: ['Some task', 'Another task'],
|
||||
});
|
||||
|
||||
|
@ -102,7 +114,7 @@ describe('checkOffTodoList', () => {
|
|||
- [ ] Write unit tests
|
||||
- [ ] Implement feature`;
|
||||
|
||||
const result = await checkOffTodoListTool.execute({
|
||||
const result = await run({
|
||||
todoItems: ['Non-existent task', 'Another missing task'],
|
||||
});
|
||||
|
||||
|
@ -121,7 +133,7 @@ describe('checkOffTodoList', () => {
|
|||
- [ ] Implement feature
|
||||
- [ ] Review code`;
|
||||
|
||||
const result = await checkOffTodoListTool.execute({
|
||||
const result = await run({
|
||||
todoItems: ['Write unit tests', 'Implement feature'],
|
||||
});
|
||||
|
||||
|
@ -137,7 +149,7 @@ describe('checkOffTodoList', () => {
|
|||
todoList = `## Todo List
|
||||
- [ ] Write unit tests`;
|
||||
|
||||
const result = await checkOffTodoListTool.execute({
|
||||
const result = await run({
|
||||
todoItems: [],
|
||||
});
|
||||
|
||||
|
@ -153,7 +165,7 @@ describe('checkOffTodoList', () => {
|
|||
- [ ] Write unit tests
|
||||
- [ ] Implement feature`;
|
||||
|
||||
const result = await checkOffTodoListTool.execute({
|
||||
const result = await run({
|
||||
todoItems: ['Write unit tests'],
|
||||
});
|
||||
|
||||
|
@ -164,5 +176,4 @@ describe('checkOffTodoList', () => {
|
|||
expect(lines[2]).toBe('- [ ] Write unit tests');
|
||||
expect(result.checkedOffItems).toEqual(['Write unit tests']);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -1,11 +1,25 @@
|
|||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
import { createUpdateClarificationsFileTool } from './update-clarifications-file-tool';
|
||||
import type {
|
||||
UpdateClarificationsFileToolInput,
|
||||
UpdateClarificationsFileToolOutput,
|
||||
} from './update-clarifications-file-tool';
|
||||
|
||||
describe('updateClarificationsFile', () => {
|
||||
let updateClarificationsFileTool: ReturnType<typeof createUpdateClarificationsFileTool>;
|
||||
let clarifications: any[];
|
||||
let updateClarificationsCalled: boolean;
|
||||
|
||||
// Helper to call execute with a concrete signature
|
||||
const run = async (
|
||||
input: UpdateClarificationsFileToolInput
|
||||
): Promise<UpdateClarificationsFileToolOutput> => {
|
||||
const exec = updateClarificationsFileTool.execute as (
|
||||
i: UpdateClarificationsFileToolInput
|
||||
) => Promise<UpdateClarificationsFileToolOutput>;
|
||||
return exec(input);
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
clarifications = [];
|
||||
updateClarificationsCalled = false;
|
||||
|
@ -21,7 +35,7 @@ describe('updateClarificationsFile', () => {
|
|||
});
|
||||
|
||||
it('should add a clarification question successfully', async () => {
|
||||
const result = await updateClarificationsFileTool.execute({
|
||||
const result = await run({
|
||||
clarifications: [
|
||||
{
|
||||
issue: 'Database connection configuration',
|
||||
|
@ -52,7 +66,7 @@ describe('updateClarificationsFile', () => {
|
|||
|
||||
it('should overwrite previous clarification when adding new one', async () => {
|
||||
// Add first clarification
|
||||
await updateClarificationsFileTool.execute({
|
||||
await run({
|
||||
clarifications: [
|
||||
{
|
||||
issue: 'First issue',
|
||||
|
@ -63,7 +77,7 @@ describe('updateClarificationsFile', () => {
|
|||
});
|
||||
|
||||
// Add second clarification
|
||||
const result = await updateClarificationsFileTool.execute({
|
||||
const result = await run({
|
||||
clarifications: [
|
||||
{
|
||||
issue: 'Second issue',
|
||||
|
@ -89,7 +103,7 @@ describe('updateClarificationsFile', () => {
|
|||
it('should handle very long clarification content', async () => {
|
||||
const longText = 'A'.repeat(1000);
|
||||
|
||||
const result = await updateClarificationsFileTool.execute({
|
||||
const result = await run({
|
||||
clarifications: [
|
||||
{
|
||||
issue: longText,
|
||||
|
@ -105,9 +119,8 @@ describe('updateClarificationsFile', () => {
|
|||
expect(result.clarifications?.[0]?.clarificationQuestion).toBe(`${longText}?`);
|
||||
});
|
||||
|
||||
|
||||
it('should handle empty strings', async () => {
|
||||
const result = await updateClarificationsFileTool.execute({
|
||||
const result = await run({
|
||||
clarifications: [
|
||||
{
|
||||
issue: '',
|
||||
|
@ -128,7 +141,7 @@ describe('updateClarificationsFile', () => {
|
|||
});
|
||||
|
||||
it('should handle special characters in clarification content', async () => {
|
||||
const result = await updateClarificationsFileTool.execute({
|
||||
const result = await run({
|
||||
clarifications: [
|
||||
{
|
||||
issue: 'Issue with "quotes" and \'apostrophes\'',
|
||||
|
|
Loading…
Reference in New Issue