diff --git a/modules/audit-logger/test/audit.test.ts b/modules/audit-logger/test/audit.test.ts index db09111..b7d3dee 100644 --- a/modules/audit-logger/test/audit.test.ts +++ b/modules/audit-logger/test/audit.test.ts @@ -15,7 +15,7 @@ test("audit-logger records every event to the trail as one line each", async () const path = join(dir, "audit.log"); // The audit-logger's whole behaviour: consume everything, record it. - await on("**", async (event) => record(event, path)); + await on("#", async (event) => record(event, path)); // the pattern index.ts subscribes process.env.MESH_MODULE = "umami"; process.env.MESH_NODE = "anchor"; @@ -24,7 +24,9 @@ test("audit-logger records every event to the trail as one line each", async () const lines = (await readFile(path, "utf8")).trim().split("\n").map((l) => JSON.parse(l)); assert.equal(lines.length, 2); - assert.deepEqual(lines.map((l) => l.type), ["umami.site.created", "node.anchor.joined"]); + // A module names its events locally (design 29); the module is the `source`, which together with + // the type says whose event it was. This broker does no namespacing, so the type is as emitted. + assert.deepEqual(lines.map((l) => l.type), ["site.created", "node.anchor.joined"]); assert.equal(lines[0].source, "umami"); assert.equal(lines[0].node, "anchor"); assert.equal(lines[0].body.domain, "my-app");