templates.test.ts
This file
Path
packages/notify/test/templates.test.ts
20 lines · 557 bytes · TypeScript
Last changed by
History of this fileTake it
123456789101112131415161718192021import assert from "node:assert/strict";import { test } from "node:test";
import { API } from "@burrow/kit";import { fakeTransport } from "@burrow/kit/testing";
import { render } from "../src/index.ts";
const { transport } = fakeTransport( new Map([ [`${API}/templates/welcome`, "Hello {{name}}, welcome to {{team}}."], ]));
test("fills a template's slots, and leaves unknown ones as they are", async () => { assert.equal( await render("welcome", new Map([["name", "Wren"]]), transport), "Hello Wren, welcome to {{team}}." );});