diff options
| author | Wes Bos <wesbos@gmail.com> | 2017-08-11 14:56:13 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2017-08-11 14:56:13 -0400 |
| commit | 416c2cbae0e69b724876d232bf813eefd7550174 (patch) | |
| tree | ce7109c0f61dbeee7077164cb48a4681214e0464 /functions/createCharge.test.js | |
| parent | 222ab374d53a206332b1ab51c7c43f6d5dc7a31e (diff) | |
getting there
Diffstat (limited to 'functions/createCharge.test.js')
| -rw-r--r-- | functions/createCharge.test.js | 26 |
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); + }); + +}); + |
