wallets-africa
Version:
Nodejs API wrapper for wallets africa
56 lines (55 loc) • 1.83 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = __importDefault(require("../index"));
const chai_1 = require("chai");
/*
Self resource tests file
*/
// The key is supplied from package.json under the scripts command
const wallet = new index_1.default({
secretKey: process.env.SECRET_KEY,
publicKey: process.env.PUBLIC_KEY,
sandbox: true,
});
describe('Self resource tests', function () {
it('Check balance', async function () {
const res = await wallet.self.checkBalance();
chai_1.assert.strictEqual(res.status, 200);
chai_1.assert.containsAllDeepKeys(res.data, {
Response: {
ResponseCode: '200',
},
});
});
it('Transactions', async function () {
const res = await wallet.self.transactions();
chai_1.assert.strictEqual(res.status, 200);
chai_1.assert.containsAllDeepKeys(res.data, {
Response: {
ResponseCode: '200',
},
});
});
it('Verify BVN', async function () {
const res = await wallet.self.verifyBvn({
bvn: process.env.BVN,
dateOfBirth: process.env.BVN_DATE,
});
chai_1.assert.strictEqual(res.status, 200);
chai_1.assert.containsAllDeepKeys(res.data, {
BVN: process.env.BVN,
});
});
it('Get Wallets', async function () {
const res = await wallet.self.getWallets();
chai_1.assert.strictEqual(res.status, 200);
chai_1.assert.containsAllDeepKeys(res.data, {
Response: {
ResponseCode: '200',
},
});
});
});