mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 17:41:51 +00:00
style: format server and shared with prettier
A mechanical prettier --write over server/src, server/tests, server/scripts and shared/src with the workspaces' .prettierrc; nothing but layout and import order changes, and every file keeps the same set of imports. shared is formatted throughout and its format baseline is empty. The server baseline keeps the 35 files that Prettier would grow past their lint:size limit (they need a split first, which is not a formatting change), and the generated entity files stay as their generator writes them.
This commit is contained in:
@@ -3,15 +3,16 @@
|
||||
* SettingsService, which owns them. Same path, same audit action, same 400 envelope on
|
||||
* a rejected write — these cases came over with the routes.
|
||||
*/
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import { HttpException } from '@nestjs/common';
|
||||
import type { RuntimeEnvService } from '../../../src/nest/app-config/runtime-env.service';
|
||||
import type { AuditService } from '../../../src/nest/audit/audit.service';
|
||||
import { AdminDefaultUserSettingsController } from '../../../src/nest/settings/settings.controller';
|
||||
import { SettingsModule } from '../../../src/nest/settings/settings.module';
|
||||
import type { SettingsService } from '../../../src/nest/settings/settings.service';
|
||||
import type { AuditService } from '../../../src/nest/audit/audit.service';
|
||||
import type { User } from '../../../src/types';
|
||||
import { expectRegisteredController } from '../../helpers/module-providers';
|
||||
import type { RuntimeEnvService } from '../../../src/nest/app-config/runtime-env.service';
|
||||
import { HttpException } from '@nestjs/common';
|
||||
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
|
||||
const user = { id: 1, role: 'admin' } as User;
|
||||
const req = { headers: {}, socket: {} } as never;
|
||||
@@ -23,7 +24,14 @@ function controller(over: Partial<SettingsService> = {}) {
|
||||
setAdminUserDefaults: vi.fn(),
|
||||
...over,
|
||||
} as unknown as SettingsService;
|
||||
return { c: new AdminDefaultUserSettingsController(settings, { writeAudit } as unknown as AuditService, { isManaged: () => false } as unknown as RuntimeEnvService), settings };
|
||||
return {
|
||||
c: new AdminDefaultUserSettingsController(
|
||||
settings,
|
||||
{ writeAudit } as unknown as AuditService,
|
||||
{ isManaged: () => false } as unknown as RuntimeEnvService,
|
||||
),
|
||||
settings,
|
||||
};
|
||||
}
|
||||
|
||||
const thrown = async (run: () => unknown) => {
|
||||
@@ -74,7 +82,10 @@ describe('AdminDefaultUserSettingsController', () => {
|
||||
throw 'plain string';
|
||||
}),
|
||||
} as Partial<SettingsService>);
|
||||
expect(await thrown(() => c.update(user, {} as never, req))).toEqual({ status: 400, body: { error: 'plain string' } });
|
||||
expect(await thrown(() => c.update(user, {} as never, req))).toEqual({
|
||||
status: 400,
|
||||
body: { error: 'plain string' },
|
||||
});
|
||||
});
|
||||
|
||||
it('DEFAULTS-005 the class is listed in its module controllers', () => {
|
||||
|
||||
Reference in New Issue
Block a user