summaryrefslogtreecommitdiffstats
path: root/functions/createCharge.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'functions/createCharge.test.js')
-rw-r--r--functions/createCharge.test.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/functions/createCharge.test.js b/functions/createCharge.test.js
new file mode 100644
index 0000000..18e13ba
--- /dev/null
+++ b/functions/createCharge.test.js
@@ -0,0 +1,26 @@
+const takeMoney = require('./createCharge');
+
+const event = {
+ "data": {
+ "amount": 5,
+ "createdAt": "2017-08-08T19:48:39.436Z",
+ "id": "cj6400x3g00003i5zufoucron",
+ "token": "tok_visa",
+ "updatedAt": "2017-08-08T19:48:39.436Z"
+ },
+ "context": {
+ "headers": {}
+ }
+}
+
+
+describe('Take Money', () => {
+
+ test('A charge has come back', async () => {
+ const res = await takeMoney(event);
+ console.log(res);
+ expect(res.data.amount).toBeGreaterThanOrEqual(0);
+ });
+
+});
+