Add overview repo and verae-nats-process expansion template
Some checks are pending
offline / test (push) Waiting to run
Some checks are pending
offline / test (push) Waiting to run
High-level system map with diagrams, TOC, and a docs index. Template worker shows how to add a new verae.* address for search, storage, or unplanned functions without teaching Zapier NATS.
This commit is contained in:
parent
a694f246fb
commit
a32c91475c
37 changed files with 767 additions and 0 deletions
21
packages/verae-nats-process/test/handle.test.js
Normal file
21
packages/verae-nats-process/test/handle.test.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { handle } from '../src/handle.js';
|
||||
import { SUBJECTS } from '../src/subjects.js';
|
||||
|
||||
describe('verae-nats-process template', () => {
|
||||
it('uses the verae.area.resource.action address pattern', () => {
|
||||
assert.equal(SUBJECTS.IN, 'verae.example.process.in');
|
||||
assert.equal(SUBJECTS.OUT, 'verae.example.process.out');
|
||||
assert.match(SUBJECTS.reply('abc'), /^verae\.example\.process\.reply\.abc$/);
|
||||
});
|
||||
|
||||
it('handle requires correlation and is idempotent-shaped', () => {
|
||||
assert.throws(() => handle({}), /correlationId/);
|
||||
const a = handle({ correlationId: 'c1', payload: { q: 1 } });
|
||||
const b = handle({ correlationId: 'c1', payload: { q: 1 } });
|
||||
assert.equal(a.ok, true);
|
||||
assert.equal(a.correlationId, b.correlationId);
|
||||
assert.equal(a.echo.q, 1);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue