This commit is contained in:
19
scripts/stubs/react-hot-toast.js
vendored
Normal file
19
scripts/stubs/react-hot-toast.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* A no-op stand-in for `react-hot-toast`, used only by scripts/skill-check.mjs.
|
||||
*
|
||||
* The real package evaluates `goober`, which calls `document.createElement` the
|
||||
* moment it is imported. That makes the whole design-system barrel — and so the
|
||||
* Owliver block renderers — impossible to load in Node, which would leave the
|
||||
* citation tests asserting on block objects rather than on rendered markup.
|
||||
*
|
||||
* Nothing under test ever raises a toast, so a stub costs nothing and buys the
|
||||
* stronger assertion: the real renderers, producing real HTML.
|
||||
*/
|
||||
const noop = () => '';
|
||||
export const toast = Object.assign(noop, {
|
||||
success: noop, error: noop, loading: noop, custom: noop, dismiss: noop, remove: noop, promise: noop,
|
||||
});
|
||||
export const Toaster = () => null;
|
||||
export const useToaster = () => ({ toasts: [], handlers: {} });
|
||||
export const useToasterStore = () => ({ toasts: [] });
|
||||
export default toast;
|
||||
Reference in New Issue
Block a user