• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nestjs / nest / 4afa0176-b936-482c-ad88-b635a9db93b4

14 Jul 2025 11:37AM UTC coverage: 88.866% (-0.02%) from 88.886%
4afa0176-b936-482c-ad88-b635a9db93b4

Pull #15386

circleci

kamilmysliwiec
style: address linter warnings
Pull Request #15386: feat: enhance introspection capabilities

2714 of 3431 branches covered (79.1%)

101 of 118 new or added lines in 15 files covered. (85.59%)

12 existing lines in 1 file now uncovered.

7239 of 8146 relevant lines covered (88.87%)

16.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.75
/packages/core/helpers/http-adapter-host.ts
1
import { Observable, ReplaySubject, Subject } from 'rxjs';
1✔
2
import { AbstractHttpAdapter } from '../adapters/http-adapter';
3

4
/**
5
 * Defines the `HttpAdapterHost` object.
6
 *
7
 * `HttpAdapterHost` wraps the underlying
8
 * platform-specific `HttpAdapter`.  The `HttpAdapter` is a wrapper around the underlying
9
 * native HTTP server library (e.g., Express).  The `HttpAdapterHost` object
10
 * provides methods to `get` and `set` the underlying HttpAdapter.
11
 *
12
 * @see [Http adapter](https://docs.nestjs.com/faq/http-adapter)
13
 *
14
 * @publicApi
15
 */
16
export class HttpAdapterHost<
1✔
17
  T extends AbstractHttpAdapter = AbstractHttpAdapter,
18
> {
19
  private _httpAdapter?: T;
20
  private _listen$ = new Subject<void>();
456✔
21
  private _init$ = new ReplaySubject<void>();
456✔
22
  private isListening = false;
456✔
23

24
  /**
25
   * Accessor for the underlying `HttpAdapter`
26
   *
27
   * @param httpAdapter reference to the `HttpAdapter` to be set
28
   */
29
  set httpAdapter(httpAdapter: T) {
30
    this._httpAdapter = httpAdapter;
3✔
31

32
    this._init$.next();
3✔
33
    this._init$.complete();
3✔
34
  }
35

36
  /**
37
   * Accessor for the underlying `HttpAdapter`
38
   *
39
   * @example
40
   * `const httpAdapter = adapterHost.httpAdapter;`
41
   */
42
  get httpAdapter(): T {
43
    return this._httpAdapter as T;
1✔
44
  }
45

46
  /**
47
   * Observable that allows to subscribe to the `listen` event.
48
   * This event is emitted when the HTTP application is listening for incoming requests.
49
   */
50
  get listen$(): Observable<void> {
51
    return this._listen$.asObservable();
1✔
52
  }
53

54
  /**
55
   * Observable that allows to subscribe to the `init` event.
56
   * This event is emitted when the HTTP application is initialized.
57
   */
58
  get init$(): Observable<void> {
NEW
59
    return this._init$.asObservable();
×
60
  }
61

62
  /**
63
   * Sets the listening state of the application.
64
   */
65
  set listening(listening: boolean) {
66
    this.isListening = listening;
1✔
67

68
    if (listening) {
1!
69
      this._listen$.next();
1✔
70
      this._listen$.complete();
1✔
71
    }
72
  }
73

74
  /**
75
   * Returns a boolean indicating whether the application is listening for incoming requests.
76
   */
77
  get listening(): boolean {
78
    return this.isListening;
2✔
79
  }
80
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc