Skip to content

Commit

Permalink
fix(repository): fix test case for repository.execute
Browse files Browse the repository at this point in the history
Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
  • Loading branch information
raymondfeng committed Aug 21, 2020
1 parent d57b810 commit ff0c969
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -726,8 +726,12 @@ describe('DefaultCrudRepository', () => {
});

it(`throws error when execute() not implemented by ds connector`, async () => {
delete ds.execute;
const repo = new DefaultCrudRepository(Note, ds);
const memDs = new juggler.DataSource({
name: 'db',
connector: 'memory',
});
delete memDs.connector!.execute;
const repo = new DefaultCrudRepository(Note, memDs);
await expect(repo.execute('query', [])).to.be.rejectedWith(
'execute() must be implemented by the connector',
);
Expand Down

0 comments on commit ff0c969

Please sign in to comment.