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

strongloop / loopback-next / 15917 / 1
76%
master: 76%

Build:
DEFAULT BRANCH: master
Ran 24 Feb 2020 07:02PM UTC
Files 452
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Feb 2020 06:10PM UTC coverage: 92.547% (-0.01%) from 92.558%
TASK=test

push

travis-ci-com

raymondfeng
feat(repository): make `targetsMany` property required

Modify `RelationDefinitionBase` to require all relation definitions
to provide value of `targetsMany` field.

BREAKING CHANGE: If you are building a custom relation type with its
own definition interface, make sure the interface includes `targetsMany`
property. Typically, the type of this property is hard-coded as `true`
or `false`, depending on the relation type.

```ts
interface HasManyDefinition extends RelationDefinitionBase {
  type: RelationType.hasMany;
  targetsMany: true;
  // etc.
}

export interface BelongsToDefinition extends RelationDefinitionBase {
  type: RelationType.belongsTo;
  targetsMany: false;
  // etc.
}
```

When creating an instance of a relation definition, make sure to include
a value for `targetsMany` property.

```ts
new ModelDefinition('Order')
  .addRelation({
    name: 'customer',
    type: RelationType.belongsTo,
    targetsMany: false,
    source: Order,
    target: () => Customer,
    keyFrom: 'customerId',
    keyTo: 'id',
  });
```

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>

4336 of 5015 branches covered (86.46%)

Branch coverage included in aggregate %.

11222 of 11796 relevant lines covered (95.13%)

947.38 hits per line

Source Files on job 15917.1 (TASK=test)
  • Tree
  • List 0
  • Changed 55
  • Source Changed 1
  • Coverage Changed 55
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 12611
  • Travis Job 15917.1
  • cd4d43ab on github
  • Prev Job for TASK=test on master (#15910.1)
  • Next Job for TASK=test on master (#15920.1)
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