@shipstatic/drop 2.15.0 → 2.15.1-beta.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 +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -271,6 +271,14 @@ import { mockUseDrop } from '@shipstatic/drop/testing';
|
|
|
271
271
|
vi.mock('@shipstatic/drop', () => ({ useDrop: mockUseDrop({ phase: 'ready' }) }));
|
|
272
272
|
```
|
|
273
273
|
|
|
274
|
+
A few habits keep these tests honest:
|
|
275
|
+
|
|
276
|
+
- **Mock at the boundary.** Mock `DropReturn`, not drop's internals.
|
|
277
|
+
- **Test states, not implementation.** Assert on phases and what the UI shows.
|
|
278
|
+
- **Use your own spies.** Pass `vi.fn()` through `createMockDrop` overrides.
|
|
279
|
+
- **Dragging is a flag.** `createMockDrop({ isDragging: true })` works with any `phase`.
|
|
280
|
+
- **Build statuses inline.** A `DropStatus` is `{ title, details }`; there are no status factories to drift from the real copy.
|
|
281
|
+
|
|
274
282
|
## Gotchas
|
|
275
283
|
|
|
276
284
|
- **`webkitRelativePath` is the handoff.** Drop writes each file's deploy path there, and the ShipStatic SDK reads it. Don't modify it in between.
|