mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-25 05:53:44 +00:00
test(routes): drive the forwarding fallback case from data and cover re-export merges
Replace the boolean-switched forwarding fallback case with table rows instead of branching inside the test, and assert that barrel re-export facts survive worker sub-batch merges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
205787b2ca
commit
47d09da4ac
2 changed files with 29 additions and 12 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue