@noego/wood 0.1.3 → 0.2.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.
- package/README.md +35 -0
- package/dist/testing/browser.cjs +789 -0
- package/dist/testing/browser.cjs.map +1 -0
- package/dist/testing/browser.d.cts +183 -0
- package/dist/testing/browser.d.ts +183 -0
- package/dist/testing/browser.js +754 -0
- package/dist/testing/browser.js.map +1 -0
- package/dist/testing/index.cjs +5 -0
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +6 -0
- package/dist/testing/index.js.map +1 -1
- package/docs/browser-testing.md +212 -0
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -111,6 +111,41 @@ npm test
|
|
|
111
111
|
|
|
112
112
|
Publishing runs the same checks through `prepublishOnly`.
|
|
113
113
|
|
|
114
|
+
## Testing
|
|
115
|
+
|
|
116
|
+
Wood publishes browser-testing helpers from `@noego/wood/testing`.
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
import { browser } from '@noego/wood/testing';
|
|
120
|
+
|
|
121
|
+
const harness = await browser.createHarness({
|
|
122
|
+
rootDir: process.cwd(),
|
|
123
|
+
componentDir: 'ui',
|
|
124
|
+
css: ['ui/app.css'],
|
|
125
|
+
bridge: {
|
|
126
|
+
operations: {
|
|
127
|
+
'settings.get': () => ({ readSpeed: 0 }),
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const mounted = await harness.mountComponent('ui/components/StatusPanel.svelte');
|
|
133
|
+
await mounted.expect.visible('[data-testid="status-panel"]');
|
|
134
|
+
|
|
135
|
+
await harness.destroy();
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The browser harness starts Vite with the Svelte plugin, launches Playwright,
|
|
139
|
+
installs a controlled Wood bridge fixture, and can mount individual Svelte
|
|
140
|
+
components, layered Wood trees, or Wood routes from a views config.
|
|
141
|
+
|
|
142
|
+
Use it for renderer behavior that needs real CSS, browser layout, animation
|
|
143
|
+
frames, z-index, clipping, or route/controller wiring without booting Electron.
|
|
144
|
+
Keep pure service and state tests in Node.
|
|
145
|
+
|
|
146
|
+
See [Browser Testing](./docs/browser-testing.md) for the full API shape and
|
|
147
|
+
boundary notes.
|
|
148
|
+
|
|
114
149
|
## Publishing
|
|
115
150
|
|
|
116
151
|
Publishing is handled by the `Publish` GitHub Actions workflow.
|