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

panates / opra / 29494915195

16 Jul 2026 11:33AM UTC coverage: 83.024% (+0.4%) from 82.653%
29494915195

push

github

erayhanoglu
1.29.1

4118 of 5238 branches covered (78.62%)

Branch coverage included in aggregate %.

34348 of 41093 relevant lines covered (83.59%)

239.47 hits per line

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

82.69
/packages/common/src/document/common/api-base.ts
1
import { omitUndefined } from '@jsopen/objects';
1✔
2
import { OpraSchema } from '../../schema/index.js';
1✔
3
import type { ApiDocument } from '../api-document.js';
1✔
4
import { CLASS_NAME_PATTERN } from '../constants.js';
1✔
5
import { DocumentElement } from './document-element.js';
1✔
6
import type { DocumentInitContext } from './document-init-context.js';
83✔
7

83✔
8
export namespace ApiBase {
83✔
9
  export interface InitArguments extends Pick<
1✔
10
    OpraSchema.Api,
1✔
11
    'description' | 'name'
1✔
12
  > {
87✔
13
    owner: ApiDocument | ApiBase;
87✔
14
  }
87✔
15
}
87✔
16

87✔
17
export abstract class ApiBase extends DocumentElement {
87✔
18
  abstract readonly transport: OpraSchema.Transport;
87✔
19
  declare readonly owner: ApiDocument | ApiBase;
1✔
20
  name: string = 'OpraApi';
×
21
  description?: string;
×
22

×
23
  protected constructor(init: ApiBase.InitArguments) {
×
24
    super(init.owner);
×
25
    this.name = init.name;
×
26
    this.description = init.description;
×
27
  }
×
28

×
29
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1✔
30
  toJSON(options?: ApiDocument.ExportOptions): OpraSchema.Api {
1✔
31
    return omitUndefined<OpraSchema.Api>({
1✔
32
      transport: this.transport,
1✔
33
      name: this.name,
1✔
34
      description: this.description,
1✔
35
    });
1✔
36
  }
1✔
37

1✔
38
  protected async _initialize(
1✔
39
    init: ApiBase.InitArguments,
1✔
40
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
1✔
41
    context: DocumentInitContext,
1✔
42
  ) {
1✔
43
    if (!CLASS_NAME_PATTERN.test(init.name))
1✔
44
      throw new TypeError(`Invalid api name (${init.name})`);
1✔
45
    this.name = init.name;
1✔
46
    this.description = init?.description;
1✔
47
  }
1✔
48
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc