@joystick.js/test-canary 0.0.0-canary.67 → 0.0.0-canary.68

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.
@@ -6,4 +6,4 @@ import{parseHTML as m}from"linkedom";import w from"@joystick.js/ui-canary";impor
6
6
  <meta name="csrf" content="joystick_test" />
7
7
  </body>
8
8
  </html>
9
- `),{window:c,document:e,Element:s,Event:n,HTMLElement:l}=t;return global.window=c,global.document=e,global.HTMLElement=l,global.Element=s,global.Event=n,global.console={log:console.log,warn:console.warn,error:console.error},t};var T=async(t="",c={})=>{const e=g();window.fetch=d,window.location={origin:`http://localhost:${process.env.PORT}`};const s=new p(`${window?.location?.origin}/api/_test/bootstrap`);s.search=new u({pathToComponent:t});const n=await d(s).then(async o=>o.json());console.log(n),window.joystick={},window.__joystick_data__=n?.data||{},window.__joystick_i18n__=n?.translations||{},window.__joystick_req__={params:{},query:{},context:{user:{}}};const l=await _(t,{default:!0}),r=w.mount(l,c?.props||{},e?.document.querySelector("#app"));return r.isTest=!0,{dom:e,instance:r,test:{data:async(o={})=>r?.data?.refetch(o),render:()=>{const o=r?.renderToHTML(),a=new RegExp("<when>|</when>","g");return o?.wrapped?.replace(a,"")?.trim()},method:(o="",...a)=>{const i=r?.methods[o];return i?i(...a):null},event:(o="",a="")=>h(o,a,e)}}};export{T as default};
9
+ `),{window:c,document:e,Element:s,Event:n,HTMLElement:l}=t;return global.window=c,global.document=e,global.HTMLElement=l,global.Element=s,global.Event=n,global.console={log:console.log,warn:console.warn,error:console.error},t};var T=async(t="",c={})=>{const e=g();window.fetch=d,window.location={origin:`http://localhost:${process.env.PORT}`};const s=new p(`${window?.location?.origin}/api/_test/bootstrap`);s.search=new u({pathToComponent:t});const n=await d(s).then(async o=>o.json());console.log(n),window.joystick={},window.__joystick_data__=n?.data||{},window.__joystick_i18n__=n?.translations||{},window.__joystick_req__={params:{},query:{},context:{user:{}}};const l=await _(t,{default:!0}),r=w.mount(l,c?.props||{},e?.document.querySelector("#app"));return r.isTest=!0,{dom:e,instance:r,test:{data:async(o={})=>r?.data?.refetch(o),render:()=>{const o=r?.renderToHTML(),a=new RegExp("<when>|</when>","g");return o?.wrapped?.replace(a,"")?.replace(/\n|\t/g," ")},method:(o="",...a)=>{const i=r?.methods[o];return i?i(...a):null},event:(o="",a="")=>h(o,a,e)}}};export{T as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@joystick.js/test-canary",
3
3
  "type": "module",
4
- "version": "0.0.0-canary.67",
4
+ "version": "0.0.0-canary.68",
5
5
  "description": "Isomorphic testing framework for the Joystick JavaScript framework.",
6
6
  "main": "dist/index.js",
7
7
  "scripts": {
@@ -84,7 +84,7 @@ export default async (pathToComponent = '', options = {}) => {
84
84
  render: () => {
85
85
  const html = component?.renderToHTML();
86
86
  const whenRegex = new RegExp('<when>|</when>', 'g');
87
- return html?.wrapped?.replace(whenRegex, '')?.trim();
87
+ return html?.wrapped?.replace(whenRegex, '')?.replace(/\n|\t/g, ' ');
88
88
  },
89
89
  method: (methodName = '', ...methodArgs) => {
90
90
  const methodToCall = component?.methods[methodName];