From ae03ccc44f49ab843911d8688ec863a8eab592ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Louren=C3=A7o?= Date: Fri, 17 Nov 2023 10:54:28 -0300 Subject: [PATCH] fixup! perf: prefer use factory instead of use value when possible --- packages/core/test/router/router-module.spec.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/core/test/router/router-module.spec.ts b/packages/core/test/router/router-module.spec.ts index 4b198e916be..472c391e060 100644 --- a/packages/core/test/router/router-module.spec.ts +++ b/packages/core/test/router/router-module.spec.ts @@ -16,12 +16,15 @@ describe('RouterModule', () => { describe('register', () => { it('should return a dynamic module with routes registered as a provider', () => { - const moduleRegistered = RouterModule.register(routes); - const provider = moduleRegistered.providers.find( - p => 'useFactory' in p && p.provide === ROUTES, - ) as FactoryProvider; - expect(provider).to.not.be.undefined; - expect(provider.useFactory()).to.be.eq(routes); + expect(RouterModule.register(routes)).to.deep.equal({ + module: RouterModule, + providers: [ + { + provide: ROUTES, + useValue: routes, + }, + ], + }); }); }); describe('when instantiated', () => {