Skip to content

Commit

Permalink
fix: readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed May 19, 2021
1 parent 3936eea commit 6afddb8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ import { getTracker, MockClient } from 'knex-mock-client';
import faker from 'faker';

jest.mock('../common/db-setup', () => {
return knex({ client: MockClient });
return {
db: knex({ client: MockClient })
};
});

describe('my-cool-controller tests', () => {
Expand Down Expand Up @@ -93,7 +95,7 @@ Each one of `on` methods (`select`, `insert`,`update`, `delete`) are accepting a
tracker.on
.insert(
({ method, sql, bindings }: RawQuery) =>
method === 'delete' && /^insert into users/.test(sql) && bindings.includes('secret-token')
method === 'insert' && /^insert into `users`/.test(sql) && bindings.includes('secret-token')
)
.response([]);
```
Expand Down

0 comments on commit 6afddb8

Please sign in to comment.