query test progress

This commit is contained in:
2026-03-10 18:25:29 -04:00
parent bb263190f6
commit 1c08a8f2b8
20 changed files with 1949 additions and 225 deletions

58
migrate_fixtures.js Normal file
View File

@ -0,0 +1,58 @@
const fs = require('fs');
const path = require('path');
const fixturesDir = path.join(__dirname, 'tests', 'fixtures');
function processFile(filePath) {
const content = fs.readFileSync(filePath, 'utf8');
let data;
try {
data = JSON.parse(content);
} catch (e) {
console.error(`Skipping ${filePath} due to parse error`);
return;
}
let modified = false;
data.forEach(suite => {
if (suite.tests) {
suite.tests.forEach(test => {
if (test.valid !== undefined || test.expect_errors !== undefined) {
if (!test.expect) {
test.expect = {};
}
if (test.valid !== undefined) {
test.expect.success = test.valid;
delete test.valid;
}
if (test.expect_errors !== undefined) {
test.expect.errors = test.expect_errors;
delete test.expect_errors;
}
modified = true;
}
});
}
});
if (modified) {
fs.writeFileSync(filePath, JSON.stringify(data, null, 4));
console.log(`Migrated ${filePath}`);
}
}
function walkDir(dir) {
const files = fs.readdirSync(dir);
files.forEach(file => {
const fullPath = path.join(dir, file);
if (fs.statSync(fullPath).isDirectory()) {
walkDir(fullPath);
} else if (fullPath.endsWith('.json')) {
processFile(fullPath);
}
});
}
walkDir(fixturesDir);
console.log('Done migrating fixtures!');