mirror of
https://github.com/strapi/strapi.git
synced 2025-12-26 14:44:31 +00:00
Mock audit log provider in API tests
This commit is contained in:
parent
9ef1bea85f
commit
10274e4685
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user