@gjsify/unit 0.36.0 → 0.37.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.
Files changed (2) hide show
  1. package/lib/types/index.d.ts +10 -34
  2. package/package.json +12 -12
@@ -16,6 +16,12 @@ export interface Namespaces {
16
16
  export type Callback = () => void | Promise<void>;
17
17
  export type Runtime = 'Gjs' | 'Deno' | 'Node.js' | 'Unknown' | 'Browser' | 'Display';
18
18
  export declare const print: (...data: any[]) => void;
19
+ /**
20
+ * Render any value for an assertion failure message WITHOUT throwing.
21
+ * Template-literal / `+` interpolation throws a TypeError on `symbol` and `bigint`
22
+ * operands, which would mask the real assertion result, so matchers route operands
23
+ * through this rather than interpolating them.
24
+ */
19
25
  export declare function formatValue(value: unknown): string;
20
26
  type AnyFn = (...args: any[]) => any;
21
27
  /** A vitest-style mock function: callable with any args + records `.mock.calls`. */
@@ -84,7 +90,7 @@ export declare const describe: {
84
90
  } | number): Promise<void>;
85
91
  skip(moduleName: string, _callback?: Callback): Promise<void>;
86
92
  };
87
- /** E.g on('Deno', () { it(...) }) */
93
+ /** Run `callback` only on the named runtime(s): `on('Deno', () => { it(…) })`. */
88
94
  export declare const on: (onRuntime: Runtime | Runtime[], version: string | Callback, callback?: Callback) => Promise<void>;
89
95
  export declare const beforeEach: (callback?: Callback) => void;
90
96
  export declare const afterEach: (callback?: Callback) => void;
@@ -99,39 +105,9 @@ export declare const it: {
99
105
  } | number): Promise<void>;
100
106
  };
101
107
  /**
102
- * An EXPECTED failure — a test that asserts the correct behaviour against a
103
- * defect we cannot fix from here (an upstream bug, a platform gap).
104
- *
105
- * This is categorically NOT `it.skip`, and the difference is the whole point:
106
- *
107
- * - a skip stops running the code, so it hides forever and nothing ever tells
108
- * you the day the bug is fixed;
109
- * - `it.failing` RUNS the test, tolerates the failure it was told to expect —
110
- * and **fails the suite the moment the test starts passing**, because that
111
- * means the marker has outlived its cause and must be removed.
112
- *
113
- * So it is self-retiring: it keeps the suite honest today without turning the
114
- * gate off, and it turns itself into a task the moment upstream lands the fix.
115
- * The assertion is never weakened — the test still asserts the spec-correct
116
- * behaviour, which is what makes the pass-detection meaningful.
117
- *
118
- * `reason` is mandatory and should name the upstream defect and where it is
119
- * tracked, so the next reader does not have to re-derive why this is here.
120
- *
121
- * ```ts
122
- * await it.failing(
123
- * 'send/receive empty string',
124
- * async () => { … },
125
- * 'GStreamer webrtcdatachannel sends a zero-length buffer for the ' +
126
- * 'STRING_EMPTY PPID; RFC 8831 §6.6 requires one zero byte. Not ' +
127
- * 'reachable from JS — needs an upstream fix.',
128
- * );
129
- * ```
130
- */
131
- /**
132
- * Live view of the run counters. Exposed so `it.failing`'s own spec can assert
133
- * on what the CI gate reads (the counters) instead of scraping printed text —
134
- * the summary's wording is free to change, its accounting is not.
108
+ * Live view of the run counters. Exposed so `it.failing`'s own spec can assert on
109
+ * what the CI gate reads instead of scraping printed text — the summary's wording
110
+ * is free to change, its accounting is not.
135
111
  */
136
112
  export declare const getTestCounters: () => {
137
113
  overall: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/unit",
3
- "version": "0.36.0",
3
+ "version": "0.37.0",
4
4
  "description": "A BDD-style testing framework for Gjs",
5
5
  "module": "lib/esm/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -49,21 +49,21 @@
49
49
  "devDependencies": {
50
50
  "@girs/gjs": "^4.1.0",
51
51
  "@girs/glib-2.0": "^4.1.0",
52
- "@gjsify/cli": "^0.36.0",
52
+ "@gjsify/cli": "^0.37.0",
53
53
  "@types/node": "^25.9.2",
54
54
  "typescript": "^6.0.3"
55
55
  },
56
56
  "dependencies": {
57
- "@gjsify/abort-controller": "^0.36.0",
58
- "@gjsify/assert": "^0.36.0",
59
- "@gjsify/buffer": "^0.36.0",
60
- "@gjsify/dom-elements": "^0.36.0",
61
- "@gjsify/dom-exception": "^0.36.0",
62
- "@gjsify/node-globals": "^0.36.0",
63
- "@gjsify/process": "^0.36.0",
64
- "@gjsify/utils": "^0.36.0",
65
- "@gjsify/web-globals": "^0.36.0",
66
- "@gjsify/web-streams": "^0.36.0"
57
+ "@gjsify/abort-controller": "^0.37.0",
58
+ "@gjsify/assert": "^0.37.0",
59
+ "@gjsify/buffer": "^0.37.0",
60
+ "@gjsify/dom-elements": "^0.37.0",
61
+ "@gjsify/dom-exception": "^0.37.0",
62
+ "@gjsify/node-globals": "^0.37.0",
63
+ "@gjsify/process": "^0.37.0",
64
+ "@gjsify/utils": "^0.37.0",
65
+ "@gjsify/web-globals": "^0.37.0",
66
+ "@gjsify/web-streams": "^0.37.0"
67
67
  },
68
68
  "gjsify": {
69
69
  "tier": 1