xenopomp-essentials 0.5.0-canary.2 → 0.5.0-canary.3
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/package.json +1 -1
- package/vitest/index.mjs +1 -1
package/package.json
CHANGED
package/vitest/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expect as c,vi as t}from"vitest";import{render as
|
|
1
|
+
import{expect as c,vi as t}from"vitest";import{render as r,renderHook as i}from"@testing-library/react";import a from"ansi-colors";const l=e=>{c(()=>e()).not.toThrow()},u=(...e)=>{l(()=>r(...e))},d=(...e)=>{l(()=>i(...e))},f=e=>{t.stubEnv("CANONICAL_URL","http://localhost:4242"),t.stubEnv("IS_PRODUCTION","false"),e&&Object.entries(e).forEach(([n,o])=>t.stubEnv(n,o))},h=()=>{t.clearAllMocks(),t.resetAllMocks(),t.unstubAllEnvs(),t.unstubAllGlobals()},m=()=>{t.mock("next/navigation",()=>({useRouter:()=>({push(){}}),usePathname:()=>"/"}))},p={addBase:t.fn(),addComponents:t.fn(),addUtilities:t.fn(),addVariant:t.fn(),config:t.fn(),corePlugins:t.fn(),e:t.fn(),matchComponents:t.fn(),matchUtilities:t.fn(),matchVariant:t.fn(),theme:t.fn()};class C{_executionContext;constructor(n){this._executionContext=n}call(...n){console.debug(`${a.blue(`[${this._executionContext}]`)} ${a.green(`Custom spy is called with these args: ${a.blueBright(n.map(o=>`${o}`).join(", "))}`)}`)}}function x(e){const n=new C(e),o=t.spyOn(n,"call");return{expectToBeCalled:(...s)=>c(o).toHaveBeenCalledWith(s),expectToBeNotCalled:(...s)=>c(o).not.toHaveBeenCalledWith(s),spy:o,callSpy:(...s)=>n.call(s)}}export{d as assertHookRendering,l as assertNotThrowing,u as assertRendering,h as clearMocks,f as mockEnv,m as mockRouter,x as spyFactory,p as twApiMock};
|