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

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/index.js CHANGED
@@ -1 +1 @@
1
- import r from"./test.js";import o from"./helpers/api/index.js";import t from"./helpers/render/index.js";import e from"./helpers/databases/index.js";import m from"./helpers/email/index.js";import a from"./helpers/queues/index.js";import f from"./helpers/load/index.js";import i from"./helpers/routes/index.js";import p from"./helpers/uploaders/index.js";import s from"./helpers/websockets/index.js";var q={accounts:{login:r.login,signup:r.signup},after:r.after,afterEach:r.afterEach,api:o,before:r.before,beforeEach:r.beforeEach,render:t,databases:e,email:m,load:f,queues:a,routes:i,that:r.that,uploaders:p,websockets:s};export{q as default};
1
+ import r from"./test.js";import e from"./helpers/api/index.js";import o from"./helpers/render/index.js";import t from"./helpers/databases/index.js";import m from"./helpers/email/index.js";import a from"./helpers/queues/index.js";import f from"./helpers/load/index.js";import p from"./helpers/routes/index.js";import i from"./helpers/uploaders/index.js";import s from"./helpers/websockets/index.js";var k={accounts:{signup:r.signupUser,delete:r.deleteUser},after:r.after,afterEach:r.afterEach,api:e,before:r.before,beforeEach:r.beforeEach,render:o,databases:t,email:m,load:f,queues:a,routes:p,that:r.that,uploaders:i,websockets:s};export{k as default};
package/dist/test.js CHANGED
@@ -1 +1 @@
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};
1
+ import t from"ava";import o from"node-fetch";let s=[];class c{constructor(){t.serial.after.always(()=>{console.log("CLEANUP USERS",s)})}async signupUser(e=[]){for(let r=0;r<e?.length;r+=1){const a=e[r],n=await o(`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)}}deleteUser(e=""){o(`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)}}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.85",
4
+ "version": "0.0.0-canary.86",
5
5
  "description": "Isomorphic testing framework for the Joystick JavaScript framework.",
6
6
  "main": "dist/index.js",
7
7
  "scripts": {
package/src/index.js CHANGED
@@ -11,8 +11,9 @@ import websockets from './helpers/websockets/index.js';
11
11
 
12
12
  export default {
13
13
  accounts: {
14
- login: test.login,
15
- signup: test.signup,
14
+ // login: test.login,
15
+ signup: test.signupUser,
16
+ delete: test.deleteUser,
16
17
  },
17
18
  after: test.after,
18
19
  afterEach: test.afterEach,
package/src/test.js CHANGED
@@ -12,7 +12,7 @@ class Test {
12
12
  });
13
13
  }
14
14
 
15
- async signup(usersToSignup = []) {
15
+ async signupUser(usersToSignup = []) {
16
16
  for (let i = 0; i < usersToSignup?.length; i += 1) {
17
17
  const userToSignup = usersToSignup[i];
18
18
  const user = await fetch(`http://localhost:${process.env.PORT}/api/_accounts/signup`, {
@@ -28,7 +28,7 @@ class Test {
28
28
  }
29
29
  }
30
30
 
31
- delete(userId = '') {
31
+ deleteUser(userId = '') {
32
32
  fetch(`http://localhost:${process.env.PORT}/api/_test/accounts`, {
33
33
  method: 'DELETE',
34
34
  mode: "cors",