Skip to content

Commit e2eeb1f

Browse files
committed
refactor: rename module create function
1 parent a93fdb2 commit e2eeb1f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/http-interface.module.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('HttpInterfaceModule', () => {
2020
test('should use default http client if not given', async () => {
2121
// given
2222
const module = await Test.createTestingModule({
23-
imports: [HttpInterfaceModule.register()],
23+
imports: [HttpInterfaceModule.forRoot()],
2424
}).compile();
2525
await module.init();
2626
const app = module.createNestApplication();
@@ -36,7 +36,7 @@ describe('HttpInterfaceModule', () => {
3636
// given
3737
const httpClient = new StubHttpClient();
3838
const module = await Test.createTestingModule({
39-
imports: [HttpInterfaceModule.register({ httpClient })],
39+
imports: [HttpInterfaceModule.forRoot({ httpClient })],
4040
providers: [TestHttpService],
4141
}).compile();
4242
await module.init();

lib/http-interface.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ export interface HttpInterfaceConfig {
1414
}
1515

1616
export class HttpInterfaceModule {
17-
static register(config: HttpInterfaceConfig = {}): DynamicModule {
17+
static forRoot(config: HttpInterfaceConfig = {}): DynamicModule {
1818
return {
19+
global: true,
1920
imports: [DiscoveryModule],
2021
module: HttpInterfaceModule,
2122
providers: [

0 commit comments

Comments
 (0)