-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
38 lines (36 loc) · 1.03 KB
/
test.js
File metadata and controls
38 lines (36 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// This is is test file to test new functions
console.log("\n[Info] Starting test file...\n");
const mongo = require("./assets/mongo");
const $ = require("./assets/points/formulas");
const Points = require("./assets/points");
const fetch = require("node-fetch");
async function main() {
const data = {
canRespond: true,
member_uids: [
"b5GJNQy6EnPnjhHTbe9hFLXUw2k1",
"rtf375Rbo6SfVCQnkGVYMFKsmZ62",
],
admins: ["b5GJNQy6EnPnjhHTbe9hFLXUw2k1"],
description: "A test channel",
name: "Test channel",
campusKey: "campus_test",
image:
"https://firebase.google.com/images/brand-guidelines/logo-logomark.png",
creator: "campus42_terminal",
admin_info: {},
};
fetch(
"https://us-central1-campus42.cloudfunctions.net/createChannelFromServer",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data),
}
)
.then((response) => response.json())
.then(console.log)
.catch(console.warn)
.finally(process.exit);
}
main();