bitcore-node
Version:
A blockchain indexing node with extended capabilities using bitcore
31 lines • 1.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const walletAddress_1 = require("../../../src/models/walletAddress");
const unit_1 = require("../../helpers/unit");
describe('WalletAddress Model', function () {
before(unit_1.unitBeforeHelper);
after(unit_1.unitAfterHelper);
describe('_apiTransform', () => {
it('should return transform object with wallet addresses', () => {
let walletAddress = {
address: '2NA2xTdQH6CG73Gc26oQZ7FEmvTx9Kwo7uf'
};
const result = walletAddress_1.WalletAddressStorage._apiTransform(walletAddress, {
object: false
}).toString();
const parseResult = JSON.parse(result);
(0, chai_1.expect)(parseResult).to.deep.equal({ address: '2NA2xTdQH6CG73Gc26oQZ7FEmvTx9Kwo7uf' });
});
it('should return the raw transform object if options field exists and set to true', () => {
let walletAddress = {
address: '2NA2xTdQH6CG73Gc26oQZ7FEmvTx9Kwo7uf'
};
const result = walletAddress_1.WalletAddressStorage._apiTransform(walletAddress, {
object: true
});
(0, chai_1.expect)(result).to.deep.equal({ address: '2NA2xTdQH6CG73Gc26oQZ7FEmvTx9Kwo7uf' });
});
});
});
//# sourceMappingURL=walletAddress.spec.js.map