Skip to content

Commit

Permalink
test: add a scope test for resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Agnes Lin committed Sep 20, 2019
1 parent 200f54a commit ea98efe
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ export function belongsToInclusionResolverAcceptance(
expect(toJSON(result)).to.deepEqual(toJSON(expected));
});

it('throws error if the inclusion query contains a non-empty scope', async () => {
await orderRepo.create({
description: 'shiba',
customerId: existingCustomerId,
});
expect(
orderRepo.find({include: [{relation: 'customer'}], limit: 1}),
).to.be.rejectedWith(`Invalid "scope is not supported`);
});

it('throws error if the target repository does not have the registered resolver', async () => {
await orderRepo.create({
description: 'shiba',
Expand Down

0 comments on commit ea98efe

Please sign in to comment.