@joystick.js/test-canary 0.0.0-canary.93 → 0.0.0-canary.95

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 s from"node-fetch";let l=[];class c{constructor(){}async signupUser(e=[]){for(let t=0;t<e?.length;t+=1){const n=e[t],o=await s(`http://localhost:${process.env.PORT}/api/_test/accounts/signup`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(a=>a.json());l.push(o)}}deleteUser(e=""){return s(`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 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)}}const u=new c;var f=u;export{f as default};
1
+ import t from"ava";import a from"node-fetch";let n=[];class u{constructor(){}async signupUser(e=[]){for(let r=0;r<e?.length;r+=1){const l=e[r],c=await a(`http://localhost:${process.env.PORT}/api/_test/accounts/signup`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}).then(i=>i.json());n.push(c)}}deleteUser(e=""){return a(`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="",r=null){return t.serial(e,r)}}const o=new u;t.serial.after.always(async()=>{for(let s=0;s<n?.length;s+=1){const e=n[s];await o.deleteUser(e?._id||e?.user_id)}});var f=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.93",
4
+ "version": "0.0.0-canary.95",
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
@@ -65,14 +65,14 @@ class Test {
65
65
 
66
66
  const testInstance = new Test();
67
67
 
68
- //test.serial.after.always(async () => {
69
- // // NOTE: Nuke users who were created as part of the test run to avoid
70
- // // data collisions in other tests/suites.
71
- //
72
- // for (let i = 0; i < users?.length; i += 1) {
73
- // const user = users[i];
74
- // await testInstance.deleteUser(user?._id || user?.user_id);
75
- // }
76
- //});
68
+ test.serial.after.always(async () => {
69
+ // NOTE: Nuke users who were created as part of the test run to avoid
70
+ // data collisions in other tests/suites.
71
+
72
+ for (let i = 0; i < users?.length; i += 1) {
73
+ const user = users[i];
74
+ await testInstance.deleteUser(user?._id || user?.user_id);
75
+ }
76
+ });
77
77
 
78
78
  export default testInstance;