export-mollie/tests/mollie.test.ts

42 lines
1.1 KiB
TypeScript

import { createMollieClient } from '@mollie/api-client';
import { mollieKeys, listAll } from '../src/mollie';
const log = console.log.bind(console);
test('airtable can print records', (done) => {
const mollieClient = createMollieClient({ apiKey: mollieKeys.leden });
// const entity = mollieClient.customers;
const entity = mollieClient.payments;
// const entity = mollieClient.refunds;
// const entity = mollieClient.chargebacks;
const obs = listAll(entity.list());
log('just before subscribe');
obs.subscribe({
next(x) {
log('got value ' + x);
},
error(err) {
console.error('something wrong occurred: ' + err);
},
complete() {
log('done');
done();
}
});
log('just after subscribe');
// entity
// .list()
// .then(result => {
// console.log(result);
// // const { count, nextPage, links } = result;
// // result.forEach(item => {
// // console.log(item);
// // })
// });
// // same for payments, refunds, chargebacks
// expect(true).toBe(true);
});