dsh-plugin-toolkit 0.2.1 → 0.2.2
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.
- package/CHANGELOG.md +5 -0
- package/lib/testkit/mount.mjs +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
- `unmount()` closes the jsdom window, so a panel that polls does not keep the test process alive.
|
|
6
|
+
- The first paint waits for the panel's own fetches inside `act`, which removes the flood of "not wrapped in act" warnings that buried real failures.
|
|
7
|
+
|
|
3
8
|
## 0.2.1
|
|
4
9
|
|
|
5
10
|
- A missing peer dependency now names the install command instead of failing with `ERR_MODULE_NOT_FOUND`.
|
package/lib/testkit/mount.mjs
CHANGED
|
@@ -37,7 +37,7 @@ export async function mountClient(options) {
|
|
|
37
37
|
container = 'root',
|
|
38
38
|
} = options;
|
|
39
39
|
|
|
40
|
-
const { window, document } = createDom();
|
|
40
|
+
const { dom, window, document } = createDom();
|
|
41
41
|
const restoreGlobals = installGlobals(window, document);
|
|
42
42
|
|
|
43
43
|
const need = async (name) => {
|
|
@@ -91,6 +91,9 @@ export async function mountClient(options) {
|
|
|
91
91
|
|
|
92
92
|
await act(async () => {
|
|
93
93
|
clientRoot.render(React.createElement(registered.component, props));
|
|
94
|
+
// The first paint is followed by the panel's own fetches; letting them land
|
|
95
|
+
// inside act keeps the "not wrapped in act" warnings from drowning the run.
|
|
96
|
+
for (let tick = 0; tick < 3; tick += 1) await new Promise((resolve) => setTimeout(resolve, 0));
|
|
94
97
|
});
|
|
95
98
|
|
|
96
99
|
const settle = async (run) => {
|
|
@@ -184,6 +187,9 @@ export async function mountClient(options) {
|
|
|
184
187
|
await act(async () => clientRoot.unmount());
|
|
185
188
|
globalThis.fetch = previousFetch;
|
|
186
189
|
restoreGlobals();
|
|
190
|
+
// A panel polls; jsdom's timers and rAF would keep the test process alive
|
|
191
|
+
// for as long as the app runs. Closing the window cancels them.
|
|
192
|
+
dom.window.close();
|
|
187
193
|
},
|
|
188
194
|
};
|
|
189
195
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-toolkit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Preflight, release and test DeepSeek Harness plugins: checks what the host needs, waits for npm to actually serve the version, and keeps the market index honest.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|