summaryrefslogtreecommitdiffstats
path: root/functions/createCharge.test.js
blob: 18e13ba9e12016e6f9de1b7c8948b9957c740599 (plain)
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 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);
  });

});