Unit tests go to tests/unit/<area>/, browser smoke tests to tests/smoke/<area>/, and tests against a running desktop app to tests/native/. Files named after dates, work passes, or Kanban cards get feature names, for example editorOctober12 -> editor/footnotes. scripts/ keeps the build, release, and package tools. Plugin repositories import scripts/packagePlugin.mjs, and the Terminal smoke test imports scripts/pluginMocks.mjs, which now re-exports the harness copy. The unit tests get their own type check (tests/tsconfig.json) with Node types. pnpm check runs it after the app check. Add @types/node and fix the three test mocks that it reported.
16 lines
547 B
TypeScript
16 lines
547 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
import { fenceOpenText, headingMarkText } from "../../../src/lib/editor/headingMarks.ts";
|
|
|
|
test("heading marks match the heading level", () => {
|
|
assert.equal(headingMarkText(1), "#");
|
|
assert.equal(headingMarkText(3), "###");
|
|
assert.equal(headingMarkText(6), "######");
|
|
});
|
|
|
|
test("fence open marks include the language", () => {
|
|
assert.equal(fenceOpenText(""), "```");
|
|
assert.equal(fenceOpenText("js"), "```js");
|
|
assert.equal(fenceOpenText(" pp "), "```pp");
|
|
});
|