Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

721 B
Raw Blame
import { readFile } from "node:fs/promises";
import { resolve } from "node:path";
import { describe, expect, it } from "vitest";

const DIGEST_PATTERN = /Unicode data SHA-256: ([0-9a-f]{64})/;

describe("tag Unicode data", () => {
  it("keeps the Go and TypeScript generated tables in sync", async () => {
    const [goSource, typeScriptSource] = await Promise.all([
      readFile(resolve(process.cwd(), "../markdown/parser/tag_unicode_tables.go"), "utf8"),
      readFile(resolve(process.cwd(), "src/utils/tag-unicode-data.ts"), "utf8"),
    ]);

    expect(goSource.match(DIGEST_PATTERN)?.[1]).toBeDefined();
    expect(goSource.match(DIGEST_PATTERN)?.[1]).toBe(typeScriptSource.match(DIGEST_PATTERN)?.[1]);
  });
});