mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-29 16:10:07 +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,9 +3,10 @@
|
||||
* an RPC call, config is frozen, and log is a fire-and-forget event. Runs
|
||||
* in-process against a fake transport (no fork needed).
|
||||
*/
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
import { createPluginContext, definePlugin, type ChildTransport } from '../../../src/nest/plugins/runtime/plugin-sdk';
|
||||
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
|
||||
function fakeTransport() {
|
||||
const rpc = vi.fn(async () => ({ ok: true }));
|
||||
const emit = vi.fn();
|
||||
@@ -30,7 +31,11 @@ describe('createPluginContext', () => {
|
||||
expect(rpc).toHaveBeenCalledWith('trips.getById', { tripId: 1, _inv: 'inv-1' });
|
||||
|
||||
await ctx.journal.addEntryPhoto(5, { name: 'a.jpg', content_base64: 'eA==' });
|
||||
expect(rpc).toHaveBeenCalledWith('journal.addEntryPhoto', { entryId: 5, input: { name: 'a.jpg', content_base64: 'eA==' }, _inv: 'inv-1' });
|
||||
expect(rpc).toHaveBeenCalledWith('journal.addEntryPhoto', {
|
||||
entryId: 5,
|
||||
input: { name: 'a.jpg', content_base64: 'eA==' },
|
||||
_inv: 'inv-1',
|
||||
});
|
||||
|
||||
await ctx.ws.broadcastToTrip(1, 'ping', { a: 1 });
|
||||
// carries _inv so the host can bind the acting user — without it the broadcast was refused
|
||||
@@ -58,7 +63,12 @@ describe('createPluginContext', () => {
|
||||
expect(rpc).toHaveBeenCalledWith('costs.create', { tripId: 1, input: { name: 'Hotel' }, _inv: 'inv-1' });
|
||||
|
||||
await ctx.costs.update(1, 5, { name: 'Hostel' });
|
||||
expect(rpc).toHaveBeenCalledWith('costs.update', { tripId: 1, itemId: 5, input: { name: 'Hostel' }, _inv: 'inv-1' });
|
||||
expect(rpc).toHaveBeenCalledWith('costs.update', {
|
||||
tripId: 1,
|
||||
itemId: 5,
|
||||
input: { name: 'Hostel' },
|
||||
_inv: 'inv-1',
|
||||
});
|
||||
|
||||
await ctx.costs.delete(1, 5);
|
||||
expect(rpc).toHaveBeenCalledWith('costs.delete', { tripId: 1, itemId: 5, _inv: 'inv-1' });
|
||||
|
||||
Reference in New Issue
Block a user