Direct store API traces: comment lines are skipped and each file names a tool once (a real project listed one script five times, mostly doc comments)

This commit is contained in:
CRTkafa 2026-10-22 03:22:23 +08:00
parent 5bfbcefffa
commit ee35b11341
2 changed files with 13 additions and 2 deletions

View file

@ -56,3 +56,12 @@ describe('fastlane traces', () => {
expect(f?.fix).toContain('storebound import fastlane');
});
});
describe('direct store API traces stay short', () => {
test('comment lines are skipped and each file names a tool once', () => {
const dir = mkdtempSync(join(tmpdir(), 'sb-fl2-'));
mkdirSync(join(dir, 'tools'));
writeFileSync(join(dir, 'tools/ship.mjs'), "/**\n * 4. `xcrun altool --upload-package` uploads it\n */\n// altool needs the app id\nconst words = ['xcrun', 'altool', '--upload-package'];\nrun(['xcrun', 'altool', '--validate-app']);\n");
expect(findFastlaneTraces(dir)).toEqual([expect.objectContaining({ file: 'tools/ship.mjs', line: 5, via: 'api' })]);
});
});