Skip to content

Commit

Permalink
Merge branch 'main' into watch-build
Browse files Browse the repository at this point in the history
  • Loading branch information
slavingia authored Jan 3, 2025
2 parents ad2cfa6 + a47d5d8 commit b90b8f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ shortest(`
### Running tests

```bash
pnpm shortest # Run all tests
pnpm shortest login.test.ts # Run specific test
pnpm shortest --headless # Run in headless mode using cli
pnpm shortest # Run all tests
pnpm shortest __tests__/login.test.ts # Run specific test
pnpm shortest --headless # Run in headless mode using cli
```

You can find example tests in the [`examples`](./examples) directory.
Expand Down
14 changes: 7 additions & 7 deletions packages/shortest/src/core/runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ export class TestRunner {
}
}

// Execute test with enhanced prompt
const result = await aiClient.processAction(prompt, browserTool);

if (!result) {
throw new Error("AI processing failed: no result returned");
}

// Execute before function if present
if (test.beforeFn) {
try {
Expand All @@ -274,6 +267,13 @@ export class TestRunner {
}
}

// Execute test with enhanced prompt
const result = await aiClient.processAction(prompt, browserTool);

if (!result) {
throw new Error("AI processing failed: no result returned");
}

// Parse AI result first
const finalMessage = result.finalResponse.content.find(
(block) =>
Expand Down

0 comments on commit b90b8f7

Please sign in to comment.