mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-12 15:42:20 +02:00
fix: relax contributor-mode assertions — test structure not exact phrasing
This commit is contained in:
@@ -372,16 +372,16 @@ Per the contributor mode instructions, file a field report to ${logsDir}/browse-
|
|||||||
const logFiles = fs.readdirSync(logsDir).filter(f => f.endsWith('.md'));
|
const logFiles = fs.readdirSync(logsDir).filter(f => f.endsWith('.md'));
|
||||||
expect(logFiles.length).toBeGreaterThan(0);
|
expect(logFiles.length).toBeGreaterThan(0);
|
||||||
|
|
||||||
// Verify new reflection-based format
|
// Verify report has key structural sections (agent may phrase differently)
|
||||||
const logContent = fs.readFileSync(path.join(logsDir, logFiles[0]), 'utf-8');
|
const logContent = fs.readFileSync(path.join(logsDir, logFiles[0]), 'utf-8');
|
||||||
expect(logContent).toContain('Hey gstack team');
|
// Must have a title (# heading)
|
||||||
expect(logContent).toContain('What I was trying to do');
|
expect(logContent).toMatch(/^#\s/m);
|
||||||
expect(logContent).toContain('What happened instead');
|
// Must mention the failed command or browse
|
||||||
expect(logContent).toMatch(/rating/i);
|
expect(logContent).toMatch(/browse|nonexistent|not found|no such file/i);
|
||||||
// Verify report has repro steps (agent may use "Steps to reproduce", "Repro Steps", etc.)
|
// Must have some kind of rating
|
||||||
expect(logContent).toMatch(/repro|steps to reproduce|how to reproduce/i);
|
expect(logContent).toMatch(/rating|\/10/i);
|
||||||
// Verify report has date/version footer (agent may format differently)
|
// Must have steps or reproduction info
|
||||||
expect(logContent).toMatch(/date.*2026|2026.*date/i);
|
expect(logContent).toMatch(/step|repro|reproduce/i);
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
try { fs.rmSync(contribDir, { recursive: true, force: true }); } catch {}
|
try { fs.rmSync(contribDir, { recursive: true, force: true }); } catch {}
|
||||||
|
|||||||
Reference in New Issue
Block a user