Skip to content

Commit

Permalink
Mock audit log provider in API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
remidej committed Jan 25, 2023
1 parent 9ef1bea commit 10274e4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/jest-api.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ const isoDateRegex = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;

jest.setTimeout(60000);

jest.mock('@strapi/provider-audit-logs-local', () => {
return {
register: jest.fn().mockResolvedValue({
saveEvent: jest.fn(),
findMany: jest.fn(),
deleteExpiredEvents: jest.fn(),
findOne: jest.fn(),
}),
};
});

expect.extend({
stringOrNull(received) {
const pass = typeof received === 'string' || received === null;
Expand Down

0 comments on commit 10274e4

Please sign in to comment.