@tomradex/testkit 0.26.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Writes `script` as a program at `file` (written whole, so a run meanwhile reads the old one or the new one) and returns
3
+ * the path to hand the code under test: `file` itself on macOS and Linux, `<file>.exe` on Windows, which a bare `file`
4
+ * on PATH or spawned without its extension finds as well.
5
+ */
6
+ export declare function fakeProgram(file: string, script: string): string;
7
+ //# sourceMappingURL=fake-program.d.ts.map
package/dist/herdr.d.ts CHANGED
@@ -42,6 +42,12 @@ type Reply = {
42
42
  message: string;
43
43
  };
44
44
  };
45
+ /**
46
+ * herdr has no Windows build, and Tomrade offers it nowhere there: Windows' panes are the pty host's, and the herdr plugin
47
+ * provides no terminals (packages/herdr/src/index.ts). A test of what herdr does is skipped there, rather than fail on a
48
+ * Unix socket Windows cannot listen on, or on code link opening a real terminal window in herdr's absence.
49
+ */
50
+ export declare const herdrUnsupported: boolean;
45
51
  /**
46
52
  * A server that speaks herdr's socket protocol as herdr 0.9.5 does: one JSON
47
53
  * request per line, one reply per line, and subscriptions that keep their
package/dist/home.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Makes `dir` the home folder the code under test sees, and returns how to put the person's back. Node reads HOME on
3
+ * macOS and Linux but USERPROFILE on Windows, so a test that set HOME alone read and wrote the person's real home there.
4
+ */
5
+ export declare function useHome(dir: string): () => void;
6
+ //# sourceMappingURL=home.d.ts.map
package/dist/index.d.ts CHANGED
@@ -23,9 +23,22 @@ export interface FreshOptions {
23
23
  legacyPath?: string;
24
24
  /** "none" leaves the first project to a plugin in `plugins`, as the app leaves it to onboarding. */
25
25
  firstRun?: "default" | "none";
26
+ /** This machine's device id, for tests that play two machines sharing a project; "test-device" otherwise. */
27
+ device?: string;
26
28
  }
27
29
  /** Nested fibers activate a microtask after their dependencies; this lets them. */
28
30
  export declare const settle: () => Promise<void>;
31
+ /**
32
+ * A test's time limit for work that starts processes: as given elsewhere, three times it on Windows, which starts a
33
+ * process an order slower (git: 30-36 ms a call against a few on macOS). For a test or suite that sets its own limit;
34
+ * vitest.config.ts raises the global one there.
35
+ */
36
+ export declare const spawnBudget: (ms: number) => number;
37
+ /**
38
+ * Disposes every context `fresh` booted, closing the database files they hold: before a test file removes its folder,
39
+ * since Windows will not delete a file that is still open.
40
+ */
41
+ export declare function disposeFresh(): Promise<void>;
29
42
  /** A fresh context with one project, its board and views seeded. */
30
43
  export declare function fresh(opts?: FreshOptions): Promise<{
31
44
  ctx: Context;
@@ -41,6 +54,8 @@ export declare function fresh(opts?: FreshOptions): Promise<{
41
54
  project: import("@tomradex/domain").Project;
42
55
  board: import("@tomradex/domain").Board;
43
56
  }>;
44
- export { FakeHerdr, type FakeHerdrCall, type FakePane } from "./herdr.js";
57
+ export { FakeHerdr, herdrUnsupported, type FakeHerdrCall, type FakePane } from "./herdr.js";
45
58
  export { FakeGh, type FakeGhReply } from "./gh.js";
59
+ export { fakeProgram } from "./fake-program.js";
60
+ export { useHome } from "./home.js";
46
61
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomradex/testkit",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "type": "module",
5
5
  "author": "Haoyuan Tang",
6
6
  "engines": {
@@ -27,16 +27,16 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "@tomradex/boards": "0.26.0",
31
- "@tomradex/db": "0.26.0",
32
- "@tomradex/extensions": "0.26.0",
33
- "@tomradex/fields": "0.26.0",
34
- "@tomradex/hub": "0.26.0",
35
- "@tomradex/items": "0.26.0",
36
- "@tomradex/oplog": "0.26.0",
30
+ "@tomradex/boards": "0.27.0",
31
+ "@tomradex/db": "0.27.0",
32
+ "@tomradex/extensions": "0.27.0",
33
+ "@tomradex/fields": "0.27.0",
34
+ "@tomradex/hub": "0.27.0",
35
+ "@tomradex/items": "0.27.0",
36
+ "@tomradex/oplog": "0.27.0",
37
37
  "@tomradex/plugin-sdk": "0.2.33",
38
- "@tomradex/projects": "0.26.0",
39
- "@tomradex/write": "0.26.0",
38
+ "@tomradex/projects": "0.27.0",
39
+ "@tomradex/write": "0.27.0",
40
40
  "cordis": "4.0.0-rc.8"
41
41
  }
42
42
  }