@m4trix/evals 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-simple.cjs +18 -1
- package/dist/cli-simple.cjs.map +1 -1
- package/dist/cli-simple.js +18 -1
- package/dist/cli-simple.js.map +1 -1
- package/dist/cli.cjs +18 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +18 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -1110,6 +1110,23 @@ function isRunConfigLike(value) {
|
|
|
1110
1110
|
function isTestCaseLike(value) {
|
|
1111
1111
|
return hasMethod(value, "getName") && hasMethod(value, "getTags") && hasMethod(value, "getInput");
|
|
1112
1112
|
}
|
|
1113
|
+
function collectTestCasesFromExportValues(exports) {
|
|
1114
|
+
const out = [];
|
|
1115
|
+
for (const value of exports) {
|
|
1116
|
+
if (isTestCaseLike(value)) {
|
|
1117
|
+
out.push(value);
|
|
1118
|
+
continue;
|
|
1119
|
+
}
|
|
1120
|
+
if (Array.isArray(value)) {
|
|
1121
|
+
for (const item of value) {
|
|
1122
|
+
if (isTestCaseLike(item)) {
|
|
1123
|
+
out.push(item);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
return out;
|
|
1129
|
+
}
|
|
1113
1130
|
async function walkDirectory(rootDir, excludeDirectories) {
|
|
1114
1131
|
const out = [];
|
|
1115
1132
|
async function walk(currentDir) {
|
|
@@ -1218,7 +1235,7 @@ async function collectTestCasesFromFiles(config) {
|
|
|
1218
1235
|
const found = await Promise.all(
|
|
1219
1236
|
matched.map(async (absolutePath) => {
|
|
1220
1237
|
const exports = await loadModuleExports(absolutePath);
|
|
1221
|
-
const testCases = exports
|
|
1238
|
+
const testCases = collectTestCasesFromExportValues(exports);
|
|
1222
1239
|
const relPath = path.relative(config.rootDir, absolutePath);
|
|
1223
1240
|
return testCases.map((testCase) => ({
|
|
1224
1241
|
id: toId("test-case", relPath, testCase.getName()),
|