@joystick.js/test-canary 0.0.0-canary.84 → 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 +1 -1
- package/dist/test.js +1 -1
- package/package.json +1 -1
- package/src/index.js +3 -2
- package/src/test.js +10 -7
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"./test.js";import
|
|
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
|
|
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
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.
|
|
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
|
|
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,12 +28,15 @@ class Test {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
deleteUser(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) {
|