From 4a381940c4b3d27264e860651344ff0bf896381a Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Wed, 26 Aug 2026 18:56:17 +0000 Subject: [PATCH] test(ingestion): pin the modifiers isRequestHandler must NOT reject MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The non-handler table covered the three markers that must reject and one control, but nothing covered the other half. Adding `'async'` to NON_HANDLER_MODIFIERS left all 56 tests green — and async is the dominant shape of a real Nest handler, so that widening would have silently deleted most routes in most Nest repos with the suite passing. Two reviewers reached this independently. The mutation now fails 2 tests. Also pins `override`, accessibility modifiers, and methods merely NAMED `get`/`set`/`static` — those are property_identifiers, not modifiers, and must survive. --- .../test/unit/nest-decorator-routes.test.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gitnexus/test/unit/nest-decorator-routes.test.ts b/gitnexus/test/unit/nest-decorator-routes.test.ts index 50aaa890d..e6894a271 100644 --- a/gitnexus/test/unit/nest-decorator-routes.test.ts +++ b/gitnexus/test/unit/nest-decorator-routes.test.ts @@ -624,6 +624,35 @@ describe('NestJS decorator routes', () => { ).toEqual([]); }); + // The other half of the modifier check, and the half a mutation can actually + // reach: these modifiers must NOT reject. `async` matters most — it is the + // dominant shape of a real Nest handler, so widening the exclusion set to + // include it would silently delete most routes in most Nest repos while the + // table above stayed green. `override` and an accessibility modifier are the + // other tokens that sit in the same position on a `method_definition`, and a + // method merely NAMED `get`/`set`/`static` is a property_identifier, not a + // modifier — it must survive too. + it.each([ + { label: 'an async method', member: "@Get('s') async s() {}" }, + { label: 'a public method', member: "@Get('s') public s() {}" }, + { label: 'a protected method', member: "@Get('s') protected s() {}" }, + { + label: 'an async method with an accessibility modifier', + member: "@Get('s') public async s() {}", + }, + { label: 'a method named get', member: "@Get('s') get() {}" }, + { label: 'a method named static', member: "@Get('s') static() {}" }, + ])('still emits the route for $label', ({ member }) => { + expect( + urls(` + @Controller('v') + export class C { + ${member} + } + `), + ).toEqual(['GET /v/s']); + }); + it('still emits the route for that same decorator on an instance method', () => { // The control for the table above — identical source minus the modifier. // It is what makes those three empty results evidence of the modifier