You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Name of the template to run in. You can find the list of templates in
53
+
// src/template/index.ts (these will auto-complete)
54
+
templateName: "next-app-hello-world",
55
+
// List of tool mocks to apply for this test. You can find the list of
56
+
// available mocks in src/mock/tool-mocks.ts (these will auto-complete).
57
+
// See the instructions below on how to add your own mocks
58
+
toolMocks: ["nextJsWithProjectMock"],
59
+
});
52
60
53
61
// Simulate typing in the terminal. This will await until the "turn" is over
54
62
// so any assertions on what happened will happen on the current "turn"
@@ -79,6 +87,28 @@ describe("<prompt-or-tool-name>", function (this: Mocha.Suite) {
79
87
});
80
88
```
81
89
90
+
## Adding Templates
91
+
92
+
Templates let you run your tests inside of a folder with existing project files in it. e.g. you could add a template with an iOS app in it.
93
+
94
+
1. Add the new template in a new folder `scripts/agent-evals/templates/<template-name>`
95
+
96
+
2. In `scripts/agent-evals/src/template/index.ts`, add the template name to the templates constant:
97
+
98
+
```
99
+
export const templates = [
100
+
{
101
+
name: "<template-name>",
102
+
platform: TemplatePlatform.NODE,
103
+
},
104
+
...
105
+
] as const;
106
+
```
107
+
108
+
3. Ensure you have a `.gitignore` for the template. For example, a Node.js template should ignore `node_modules`
109
+
110
+
4. Set the `TemplatePlatform` for your template. To ensure the template is setup before each test run, we'll want to add a build command for the template. If you add a new `TemplatePlatform`, update the `buildTemplates()` function for it. For example, Node.js templates will run `npm install` before they are copied into the test directory.
111
+
82
112
## Adding Mocks for MCP Tools
83
113
84
114
Mocks applied to MCP tools will completely replace their impelementation with a static output string.
0 commit comments