Make the checks pass on a fresh clone

- build.rs creates the empty browser-engine folder that tauri-build
  requires, so cargo test runs before the browser runtime is staged.
- The Table Formulas tests skip with a reason when the package is not
  built. Before, the missing module failed two whole test files.
- The installer test accepts CRLF checkouts and skips with a reason
  when the NSIS compiler is missing.
- hostTodo.spec.mjs never ran because of its extension. Its two valid
  background tests move to appearance.spec.ts with current defaults.
  The third test repeated an existing export test.
- Remove tsconfig.plugins.json. It checked the plugins/ folder, which
  moved to separate repositories in 0.1.7.
This commit is contained in:
Knotty Wyvern
2026-10-27 19:41:08 -07:00
parent 2d2a146e34
commit 90d1940c73
8 changed files with 50 additions and 53 deletions
+9 -5
View File
@@ -2,8 +2,12 @@ import test from "node:test";
import assert from "node:assert/strict";
import { ContributionRegistry, pluginHost } from "../src/lib/plugins/registry.ts";
import { ExternalSession } from "../src/lib/plugins/externalSession.ts";
// @ts-ignore The compiled package is generated by pnpm build:plugins.
import { activate } from "../plugin-packages/table-formulas/main.js";
import { existsSync } from "node:fs";
// The Table Formulas package comes from a sibling repository. Run `pnpm build:plugins` to build it.
const tableFormulasEntry = new URL("../plugin-packages/table-formulas/main.js", import.meta.url);
const tableFormulas = existsSync(tableFormulasEntry) ? await import(tableFormulasEntry.href) : undefined;
const activate = tableFormulas?.activate;
const needsTableFormulas = { skip: tableFormulas ? false : "the Table Formulas package is not built; run pnpm build:plugins" };
import { renderMarkdownHtml, renderMarkdownSections } from "../src/lib/workspace/noteHtml.ts";
import type { PluginApi } from "../src/lib/plugins/sdk.ts";
@@ -34,7 +38,7 @@ test("optional workspace creation and reads stop when the plugin is disabled", a
assert.throws(() => api.workspace.readOptional!("board.json"), /disabled/);
assert.equal(files.size, 1);
});
test("core starts without optional features and formula packages preserve source when stopped", async () => {
test("core starts without optional features and formula packages preserve source when stopped", needsTableFormulas, async () => {
assert.equal(pluginHost.get("terminal"), undefined);
assert.equal(pluginHost.get("tableFormulas"), undefined);
const source = "| A | B |\n| --- | --- |\n| 2 | =A2*3 |\n";
@@ -55,7 +59,7 @@ test("core starts without optional features and formula packages preserve source
await next.stop();
});
test("package contribution conflicts preserve the first owner and revoke access before cleanup", async () => {
test("package contribution conflicts preserve the first owner and revoke access before cleanup", needsTableFormulas, async () => {
const registry = new ContributionRegistry();
const first = new ExternalSession("first", services, () => {}, () => {}, registry);
const second = new ExternalSession("second", services, () => {}, () => {}, registry);
@@ -72,7 +76,7 @@ test("package contribution conflicts preserve the first owner and revoke access
await first.stop();
});
test("partial activation and failed cleanup cannot retain feature contributions", async () => {
test("partial activation and failed cleanup cannot retain feature contributions", needsTableFormulas, async () => {
const registry = new ContributionRegistry();
const session = new ExternalSession("failed", services, () => {}, () => {}, registry);
await assert.rejects(session.start({ activate(api) {