summaryrefslogtreecommitdiffstats
path: root/functions/createCharge.test.js
blob: 65dde47accc0bb5b059ee1c135d37fb11e706cd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const takeMoney = require('./createCharge');

const event = {
  "data": {
    "user": "cj6ntm8qic3260140vkuzif9d",
    "token": "tok_visa",
  },
  "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);
  });

});