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

ialopezg / corejs / #5

03 Nov 2023 08:38PM UTC coverage: 42.153% (-47.5%) from 89.623%
#5

push

ialopezg
feat: add microservice feature

10 of 84 branches covered (0.0%)

Branch coverage included in aggregate %.

49 of 77 new or added lines in 20 files covered. (63.64%)

155 existing lines in 21 files now uncovered.

221 of 464 relevant lines covered (47.63%)

0.51 hits per line

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

82.35
/src/common/decorators/module.decorator.ts
1
import 'reflect-metadata';
1✔
2

3
import { ModuleMetadata } from '../interfaces';
4
import { InvalidModuleConfigurationException } from '../../errors';
1✔
5
import { MODULE_METADATA } from '../constants';
1✔
6

7
/**
8
 * Provides the functionality (modules, components or services, and routes) to an application module.
9
 *
10
 * @param {ModuleMetadata} metadata Module feature definitions.
11
 *
12
 * @constructor
13
 */
14
export const Module = (metadata: ModuleMetadata): ClassDecorator => {
1✔
15
  const keys = Object.keys(metadata);
1✔
16
  const allowed = [...(Object.values(MODULE_METADATA) as string[])];
1✔
17
  
18
  keys.forEach((key) => {
1✔
19
    if (!allowed.includes(key)) {
4!
UNCOV
20
      throw new InvalidModuleConfigurationException(key);
×
21
    }
22
  });
23

24
  return (target) => {
1✔
25
    for (const property in metadata) {
1✔
26
      if (({}).hasOwnProperty.call(metadata, property)) {
4!
27
        Reflect.defineMetadata(property, metadata[property], target);
4✔
28
      }
29
    }
30
  };
31
};
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

© 2026 Coveralls, Inc