@joystick.js/test-canary 0.0.0-canary.83 → 0.0.0-canary.85

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/dist/test.js CHANGED
@@ -1 +1 @@
1
- import r from"ava";import l from"node-fetch";let a=[];class n{constructor(){r.serial.after.always(()=>{console.log("CLEANUP USERS",a)})}async signup(e=[]){for(let t=0;t<e?.length;t+=1){const o=e[t],s=await l(`http://localhost:${process.env.PORT}/api/_accounts/signup`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});a.push(s)}}login(e={}){}before(e=null){return r.serial.before(e)}beforeEach(e=null){return r.beforeEach(e)}after(e=null){return r.after.always(e)}afterEach(e=null){return r.afterEach.always(e)}that(e="",t=null){return r.serial(e,t)}}var i=new n;export{i as default};
1
+ import t from"ava";import r from"node-fetch";let s=[];class c{constructor(){t.serial.after.always(()=>{console.log("CLEANUP USERS",s)})}async signup(e=[]){for(let o=0;o<e?.length;o+=1){const a=e[o],n=await r(`http://localhost:${process.env.PORT}/api/_accounts/signup`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then(l=>l.json());s.push(n)}}delete(e=""){r(`http://localhost:${process.env.PORT}/api/_test/accounts`,{method:"DELETE",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}before(e=null){return t.serial.before(e)}beforeEach(e=null){return t.beforeEach(e)}after(e=null){return t.after.always(e)}afterEach(e=null){return t.afterEach.always(e)}that(e="",o=null){return t.serial(e,o)}}var h=new c;export{h 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.83",
4
+ "version": "0.0.0-canary.85",
5
5
  "description": "Isomorphic testing framework for the Joystick JavaScript framework.",
6
6
  "main": "dist/index.js",
7
7
  "scripts": {
package/src/test.js CHANGED
@@ -22,18 +22,21 @@ class Test {
22
22
  "Content-Type": "application/json",
23
23
  },
24
24
  body: JSON.stringify(userToSignup)
25
- });
25
+ }).then((response) => response.json());
26
26
 
27
27
  users.push(user);
28
28
  }
29
29
  }
30
30
 
31
- login(user = {}) {
32
- // TODO: When logging in, expect that node will return an object with a joystickLoginToken,
33
- // joystickTokenExpiresAt, and joystickSession "cookie." These should be made accessible
34
- // to the individual test so they can be passed in when running tests.
35
- //
36
- // test.
31
+ delete(userId = '') {
32
+ fetch(`http://localhost:${process.env.PORT}/api/_test/accounts`, {
33
+ method: 'DELETE',
34
+ mode: "cors",
35
+ headers: {
36
+ "Content-Type": "application/json",
37
+ },
38
+ body: JSON.stringify({ userId })
39
+ })
37
40
  }
38
41
 
39
42
  before(callback = null) {