generated from bitprj/Intro-To-Serverless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.1.2.js
26 lines (21 loc) · 851 Bytes
/
test.1.2.js
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
const args = require('minimist')(process.argv.slice(2))
const functions = require('./functions');
const user = args['user'];
const repo = args['repo'];
async function main() {
try { hello = require('./../../week1/helloworld.js') }
catch (e) {
await functions.throwError("Searching for 'helloworld.js'... file cannot be found", user, repo)
console.log("Searching for 'helloworld.js'... file cannot be found");
process.exit(1)
}
let helloworld = hello()
let test_output = "Hello World"
if (helloworld != test_output) {
await functions.throwError(`Got: '${helloworld}', was expecting: '${test_output}'.`, user, repo)
console.log(`Got: "${helloworld}", was expecting: "${test_output}".`)
process.exit(1)
}
console.info("Yay! 🎉🎉🎉🎉🎉🎉🎉🍾")
}
main();