Files
bch-js/test/unit/transaction-unit.js
T

37 lines
852 B
JavaScript
Raw Normal View History

/*
Unit tests for the transaction.js library.
*/
2021-03-24 07:24:08 -07:00
// Public npm libraries
import chai from 'chai'
import sinon from 'sinon'
// import cloneDeep from 'lodash.clonedeep'
2021-03-24 07:24:08 -07:00
import BCHJS from '../../src/bch-js.js'
const { assert } = chai
2021-03-24 07:24:08 -07:00
const bchjs = new BCHJS()
// const mockDataLib = require('./fixtures/transaction-mock.js')
2021-03-24 07:24:08 -07:00
describe('#TransactionLib', () => {
let sandbox
2021-11-03 07:53:42 -07:00
beforeEach(() => {
sandbox = sinon.createSandbox()
// mockData = cloneDeep(mockDataLib)
2021-11-03 07:53:42 -07:00
})
2021-03-24 07:24:08 -07:00
afterEach(() => sandbox.restore())
describe('#get', () => {
it('should proxy psf-slp-indexer', async () => {
// console.log('bchjs.Transaction: ', bchjs.Transaction)
sandbox.stub(bchjs.Transaction.psfSlpIndexer, 'tx').resolves('test data')
const result = await bchjs.Transaction.get()
assert.equal(result, 'test data')
})
})
2021-03-24 07:24:08 -07:00
})