( testSuite: EvaluateTestSuite, prompts: TestSuite['prompts'], )
| 174 | } |
| 175 | |
| 176 | function createSerializableUnifiedConfig( |
| 177 | testSuite: EvaluateTestSuite, |
| 178 | prompts: TestSuite['prompts'], |
| 179 | ): Partial<UnifiedConfig> { |
| 180 | const droppedRef = { value: false }; |
| 181 | const config = { |
| 182 | ...testSuite, |
| 183 | providers: toSerializableProviderRef(testSuite.providers), |
| 184 | defaultTest: toSerializableTestCase(testSuite.defaultTest, droppedRef), |
| 185 | tests: Array.isArray(testSuite.tests) |
| 186 | ? testSuite.tests.map((t) => toSerializableTestCase(t, droppedRef)) |
| 187 | : testSuite.tests, |
| 188 | scenarios: Array.isArray(testSuite.scenarios) |
| 189 | ? testSuite.scenarios.map((s) => toSerializableScenario(s, droppedRef)) |
| 190 | : testSuite.scenarios, |
| 191 | prompts, |
| 192 | } as Partial<UnifiedConfig>; |
| 193 | |
| 194 | if (droppedRef.value && testSuite.writeLatestResults) { |
| 195 | logger.warn( |
| 196 | 'Function-valued transform(s) in testSuite were replaced with "[inline function]" markers in the persisted config. Re-running the saved eval will not invoke them; use string expressions or file:// references if you need the config to round-trip.', |
| 197 | ); |
| 198 | } |
| 199 | |
| 200 | return config; |
| 201 | } |
| 202 | |
| 203 | async function resolveGradingProvider( |
| 204 | provider: GradingConfig['provider'], |
no test coverage detected
searching dependent graphs…