diff --git a/gitnexus/test/unit/fetch-wrapper-index.test.ts b/gitnexus/test/unit/fetch-wrapper-index.test.ts index 2c100790e..23032c24e 100644 --- a/gitnexus/test/unit/fetch-wrapper-index.test.ts +++ b/gitnexus/test/unit/fetch-wrapper-index.test.ts @@ -179,18 +179,17 @@ describe('fetch wrapper forwarding propagation', () => { expect(index.isWrapperCall(call({ kind: 'binding', bindingId: 'outer' }))).toBe(false); }); - it.each([false, true])( - 'uses the same unique fallback for forwarding, duplicate=%s', - (duplicate) => { - const defs = [ - definition('carrier', { functionName: 'send', forwardsUrl: true }), - definition('outer', { forwardsTo: [{ callee: 'send', target: { kind: 'unresolved' } }] }), - ]; - if (duplicate) defs.push(definition('other', { functionName: 'send' })); - const index = buildFetchWrapperIndex(defs); - expect(index.isWrapperCall(call({ kind: 'binding', bindingId: 'outer' }))).toBe(!duplicate); - }, - ); + it.each([ + ['a unique carrier', [], true], + ['a same-named collision', [definition('other', { functionName: 'send' })], false], + ])('uses the same unique fallback for forwarding with %s', (_shape, collisions, expected) => { + const index = buildFetchWrapperIndex([ + definition('carrier', { functionName: 'send', forwardsUrl: true }), + definition('outer', { forwardsTo: [{ callee: 'send', target: { kind: 'unresolved' } }] }), + ...collisions, + ]); + expect(index.isWrapperCall(call({ kind: 'binding', bindingId: 'outer' }))).toBe(expected); + }); it('propagates imported identity and configured overrides through forwarding', () => { const index = buildFetchWrapperIndex( diff --git a/gitnexus/test/unit/result-merge.test.ts b/gitnexus/test/unit/result-merge.test.ts index c02b6834b..70472ac36 100644 --- a/gitnexus/test/unit/result-merge.test.ts +++ b/gitnexus/test/unit/result-merge.test.ts @@ -79,6 +79,24 @@ describe('mergeResult', () => { expect(target.fetchCalls).toEqual([]); }); + it('retains barrel re-export facts across sub-batches', () => { + const target = emptyResult(); + const named = { + filePath: 'index.ts', + exportedName: 'request', + from: { specifier: './request', importedName: 'request' }, + }; + const star = { + filePath: 'index.ts', + exportedName: '*', + from: { specifier: './star', importedName: '*' }, + }; + mergeResult(target, { ...emptyResult(), fetchWrapperReexports: [named] }); + mergeResult(target, emptyResult()); + mergeResult(target, { ...emptyResult(), fetchWrapperReexports: [star] }); + expect(target.fetchWrapperReexports).toEqual([named, star]); + }); + it('sums every CFG skip bucket by language across worker sub-batches', () => { const target = emptyResult(); const first = {