|
@@ -1,6 +1,12 @@
|
|
|
|
|
+import {
|
|
|
|
|
+ vi,
|
|
|
|
|
+ beforeEach,
|
|
|
|
|
+ describe, test, expect,
|
|
|
|
|
+} from 'vitest';
|
|
|
|
|
+
|
|
|
import { ErrorV3 } from '@growi/core';
|
|
import { ErrorV3 } from '@growi/core';
|
|
|
|
|
|
|
|
-import { excludeReadOnlyUser } from '../../../src/server/middlewares/exclude-read-only-user';
|
|
|
|
|
|
|
+import { excludeReadOnlyUser } from './exclude-read-only-user';
|
|
|
|
|
|
|
|
describe('excludeReadOnlyUser', () => {
|
|
describe('excludeReadOnlyUser', () => {
|
|
|
let req;
|
|
let req;
|
|
@@ -12,9 +18,9 @@ describe('excludeReadOnlyUser', () => {
|
|
|
user: {},
|
|
user: {},
|
|
|
};
|
|
};
|
|
|
res = {
|
|
res = {
|
|
|
- apiv3Err: jest.fn(),
|
|
|
|
|
|
|
+ apiv3Err: vi.fn(),
|
|
|
};
|
|
};
|
|
|
- next = jest.fn();
|
|
|
|
|
|
|
+ next = vi.fn();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
test('should call next if user is not found', () => {
|
|
test('should call next if user is not found', () => {
|