lint + prettier

This commit is contained in:
jubnl
2026-10-06 21:50:59 +02:00
parent cb47947bb7
commit 267e0e16a2
3047 changed files with 267625 additions and 153719 deletions
+13 -3
View File
@@ -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' });