Skip to content

Commit

Permalink
fix(repository-tests): unify the usage of MixedIdType for all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Agnes Lin authored and agnes512 committed Sep 3, 2019
1 parent fa2ecdc commit 0548651
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/repository-tests/src/crud/create-retrieve.suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
property,
} from '@loopback/repository';
import {expect, toJSON} from '@loopback/testlab';
import {MixedIdType} from '../helpers.repository-tests';
import {
deleteAllModelsInDefaultDataSource,
withCrudCtx,
Expand All @@ -38,7 +39,7 @@ export function createRetrieveSuite(
generated: true,
description: 'The unique identifier for a product',
})
id: number | string;
id: MixedIdType;

@property({type: 'string', required: true})
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {Entity, model, property} from '@loopback/repository';
import {EntityCrudRepository} from '@loopback/repository';
import {expect, skipIf, toJSON} from '@loopback/testlab';
import {Suite} from 'mocha';
import {MixedIdType} from '../helpers.repository-tests';
import {
withCrudCtx,
deleteAllModelsInDefaultDataSource,
Expand Down Expand Up @@ -37,7 +38,7 @@ export function freeformPropertiesSuite(
id: true,
description: 'The unique identifier for a product',
})
id: number | string;
id: MixedIdType;

@property({type: 'string', required: true})
name: string;
Expand Down
3 changes: 2 additions & 1 deletion packages/repository-tests/src/crud/replace-by-id.suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import {Entity, model, property} from '@loopback/repository';
import {AnyObject, EntityCrudRepository} from '@loopback/repository';
import {expect, toJSON} from '@loopback/testlab';
import {MixedIdType} from '../helpers.repository-tests';
import {
deleteAllModelsInDefaultDataSource,
withCrudCtx,
Expand All @@ -31,7 +32,7 @@ export function createSuiteForReplaceById(
generated: true,
description: 'The unique identifier for a product',
})
id: number | string;
id: MixedIdType;

@property({type: 'string', required: true})
name: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/repository-tests/src/crud/transactions.suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '@loopback/repository';
import {expect, skipIf, toJSON} from '@loopback/testlab';
import {Suite} from 'mocha';
import {withCrudCtx} from '../helpers.repository-tests';
import {withCrudCtx, MixedIdType} from '../helpers.repository-tests';
import {
CrudFeatures,
CrudTestContext,
Expand Down Expand Up @@ -42,7 +42,7 @@ export function transactionSuite(
generated: true,
description: 'The unique identifier for a product',
})
id: number | string;
id: MixedIdType;

@property({type: 'string', required: true})
name: string;
Expand Down

0 comments on commit 0548651

Please sign in to comment.