@joystick.js/test-canary 0.0.0-canary.42 → 0.0.0-canary.43

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.
@@ -1,8 +1,8 @@
1
- import{parseHTML as a}from"linkedom";import d from"@joystick.js/ui-canary";import c from"./event.js";import p from"../load/index.js";const s=()=>{const t=a(`
1
+ import{parseHTML as a}from"linkedom";import d from"@joystick.js/ui-canary";import c from"./event.js";import p from"../load/index.js";const s=()=>{const n=a(`
2
2
  <html>
3
3
  <head></head>
4
4
  <body>
5
5
  <div id="app"></div>
6
6
  </body>
7
7
  </html>
8
- `),{window:n,document:r,Element:l,Event:o,HTMLElement:e}=t;return global.window=n,global.document=r,global.HTMLElement=e,global.Element=l,global.Event=o,global.console={log:console.log,warn:console.warn,error:console.error},t};var f=async(t="",n={})=>{const r=s();window.joystick={};const l=await p(t,{default:!0});return{...r,test:{method:(o="",...e)=>{const m=d.mount(l,n?.props||{},document.querySelector("#app"))?.methods[o];return m?m(...e):null},event:(o="",e="")=>(d.mount(l,n?.props||{},document.querySelector("#app")),c(o,e,r))}}};export{f as default};
8
+ `),{window:r,document:o,Element:l,Event:e,HTMLElement:t}=n;return global.window=r,global.document=o,global.HTMLElement=t,global.Element=l,global.Event=e,global.console={log:console.log,warn:console.warn,error:console.error},n};var f=async(n="",r={})=>{const o=s();window.joystick={};const l=await p(n,{default:!0});return{...o,test:{method:(e="",...t)=>{const m=d.mount(l,r?.props||{},o?.document.querySelector("#app"))?.methods[e];return m?m(...t):null},event:(e="",t="")=>(d.mount(l,r?.props||{},o?.document.querySelector("#app")),c(e,t,o))}}};export{f 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.42",
4
+ "version": "0.0.0-canary.43",
5
5
  "description": "Isomorphic testing framework for the Joystick JavaScript framework.",
6
6
  "main": "dist/index.js",
7
7
  "scripts": {
@@ -42,7 +42,7 @@ export default async (pathToComponent = '', options = {}) => {
42
42
  ...dom,
43
43
  test: {
44
44
  method: (methodName = '', ...methodArgs) => {
45
- const component = joystick.mount(Component, options?.props || {}, document.querySelector('#app'));
45
+ const component = joystick.mount(Component, options?.props || {}, dom?.document.querySelector('#app'));
46
46
  const methodToCall = component?.methods[methodName];
47
47
 
48
48
  if (!methodToCall) {
@@ -52,7 +52,7 @@ export default async (pathToComponent = '', options = {}) => {
52
52
  return methodToCall(...methodArgs);
53
53
  },
54
54
  event: (eventType = '', eventTarget = '') => {
55
- joystick.mount(Component, options?.props || {}, document.querySelector('#app'));
55
+ joystick.mount(Component, options?.props || {}, dom?.document.querySelector('#app'));
56
56
  return event(eventType, eventTarget, dom);
57
57
  },
58
58
  },