mirror of
https://github.com/bigchaindb/js-bigchaindb-driver.git
synced 2024-11-22 01:36:56 +01:00
fix: update tests to latest AVA API
Signed-off-by: getlarge <ed@getlarge.eu>
This commit is contained in:
parent
dc7634c9db
commit
736b2adc37
@ -20,14 +20,11 @@ test('HandleResponse does not throw error for response ok', t => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('baseRequest test query and vsprint', async t => {
|
test('baseRequest test query and vsprint', async t => {
|
||||||
const target = {
|
const error = await t.throwsAsync(baseRequest('https://%s.com/', {
|
||||||
message: 'HTTP Error: Requested page not reachable',
|
|
||||||
requestURI: 'https://www.google.com/teapot',
|
|
||||||
status: '418 I\'m a Teapot',
|
|
||||||
}
|
|
||||||
const error = await t.throws(baseRequest('https://%s.com/', {
|
|
||||||
urlTemplateSpec: ['google'],
|
urlTemplateSpec: ['google'],
|
||||||
query: 'teapot'
|
query: 'teapot'
|
||||||
}))
|
}), { instanceOf: Error, message: 'HTTP Error: Requested page not reachable' })
|
||||||
t.deepEqual(target, error)
|
|
||||||
|
t.is(error.requestURI, 'https://www.google.com/teapot')
|
||||||
|
t.is(error.status, '418 I\'m a Teapot')
|
||||||
})
|
})
|
||||||
|
@ -22,8 +22,13 @@ test('Payload thrown at incorrect API_PATH', async t => {
|
|||||||
status: '404 NOT FOUND',
|
status: '404 NOT FOUND',
|
||||||
requestURI: 'http://localhost:9984/api/wrong/transactions/transactionId'
|
requestURI: 'http://localhost:9984/api/wrong/transactions/transactionId'
|
||||||
}
|
}
|
||||||
const error = await t.throws(connection.getTransaction('transactionId'))
|
const error = await t.throwsAsync(connection.getTransaction('transactionId'), {
|
||||||
t.deepEqual(target, error)
|
instanceOf: Error, message: target.message
|
||||||
|
})
|
||||||
|
|
||||||
|
t.is('ResponseError', error.name)
|
||||||
|
t.is(target.status, error.status)
|
||||||
|
t.is(target.requestURI, error.requestURI)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Generate API URLS', t => {
|
test('Generate API URLS', t => {
|
||||||
@ -100,7 +105,6 @@ test('Request with custom headers', t => {
|
|||||||
t.truthy(testConn.transport.forwardRequest.calledWith(PATH, expectedOptions))
|
t.truthy(testConn.transport.forwardRequest.calledWith(PATH, expectedOptions))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Get block for a block id', t => {
|
test('Get block for a block id', t => {
|
||||||
const expectedPath = 'path'
|
const expectedPath = 'path'
|
||||||
const blockHeight = 'abc'
|
const blockHeight = 'abc'
|
||||||
@ -115,7 +119,6 @@ test('Get block for a block id', t => {
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Get transaction for a transaction id', t => {
|
test('Get transaction for a transaction id', t => {
|
||||||
const expectedPath = 'path'
|
const expectedPath = 'path'
|
||||||
const transactionId = 'abc'
|
const transactionId = 'abc'
|
||||||
@ -130,7 +133,6 @@ test('Get transaction for a transaction id', t => {
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Get list of blocks for a transaction id', t => {
|
test('Get list of blocks for a transaction id', t => {
|
||||||
const expectedPath = 'path'
|
const expectedPath = 'path'
|
||||||
const transactionId = 'abc'
|
const transactionId = 'abc'
|
||||||
@ -149,7 +151,6 @@ test('Get list of blocks for a transaction id', t => {
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Get list of transactions for an asset id', t => {
|
test('Get list of transactions for an asset id', t => {
|
||||||
const expectedPath = 'path'
|
const expectedPath = 'path'
|
||||||
const assetId = 'abc'
|
const assetId = 'abc'
|
||||||
@ -170,7 +171,6 @@ test('Get list of transactions for an asset id', t => {
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Get outputs for a public key and no spent flag', t => {
|
test('Get outputs for a public key and no spent flag', t => {
|
||||||
const expectedPath = 'path'
|
const expectedPath = 'path'
|
||||||
const publicKey = 'publicKey'
|
const publicKey = 'publicKey'
|
||||||
@ -185,7 +185,6 @@ test('Get outputs for a public key and no spent flag', t => {
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Get outputs for a public key and spent=false', t => {
|
test('Get outputs for a public key and spent=false', t => {
|
||||||
const expectedPath = 'path'
|
const expectedPath = 'path'
|
||||||
const publicKey = 'publicKey'
|
const publicKey = 'publicKey'
|
||||||
@ -201,7 +200,6 @@ test('Get outputs for a public key and spent=false', t => {
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Get outputs for a public key and spent=true', t => {
|
test('Get outputs for a public key and spent=true', t => {
|
||||||
const expectedPath = 'path'
|
const expectedPath = 'path'
|
||||||
const publicKey = 'publicKey'
|
const publicKey = 'publicKey'
|
||||||
@ -217,7 +215,6 @@ test('Get outputs for a public key and spent=true', t => {
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Get asset for text', t => {
|
test('Get asset for text', t => {
|
||||||
const expectedPath = 'path'
|
const expectedPath = 'path'
|
||||||
const search = 'abc'
|
const search = 'abc'
|
||||||
@ -232,7 +229,6 @@ test('Get asset for text', t => {
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Get metadata for text', t => {
|
test('Get metadata for text', t => {
|
||||||
const expectedPath = 'path'
|
const expectedPath = 'path'
|
||||||
const search = 'abc'
|
const search = 'abc'
|
||||||
|
@ -17,7 +17,6 @@ import {
|
|||||||
delegatedSignTransaction
|
delegatedSignTransaction
|
||||||
} from '../constants'
|
} from '../constants'
|
||||||
|
|
||||||
|
|
||||||
test('Keypair is created', t => {
|
test('Keypair is created', t => {
|
||||||
const keyPair = new Ed25519Keypair()
|
const keyPair = new Ed25519Keypair()
|
||||||
|
|
||||||
@ -25,10 +24,6 @@ test('Keypair is created', t => {
|
|||||||
t.truthy(keyPair.privateKey)
|
t.truthy(keyPair.privateKey)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// TODO: The following tests are a bit messy currently, please do:
|
|
||||||
//
|
|
||||||
// - tidy up dependency on `pollStatusAndFetchTransaction`
|
|
||||||
test('Valid CREATE transaction with default node', t => {
|
test('Valid CREATE transaction with default node', t => {
|
||||||
const conn = new Connection()
|
const conn = new Connection()
|
||||||
|
|
||||||
@ -46,7 +41,6 @@ test('Valid CREATE transaction with default node', t => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Valid CREATE transaction using async', t => {
|
test('Valid CREATE transaction using async', t => {
|
||||||
const conn = new Connection(API_PATH)
|
const conn = new Connection(API_PATH)
|
||||||
|
|
||||||
@ -62,7 +56,6 @@ test('Valid CREATE transaction using async', t => {
|
|||||||
.then(resTx => t.truthy(resTx))
|
.then(resTx => t.truthy(resTx))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Valid CREATE transaction using sync', t => {
|
test('Valid CREATE transaction using sync', t => {
|
||||||
const conn = new Connection(API_PATH)
|
const conn = new Connection(API_PATH)
|
||||||
|
|
||||||
@ -78,7 +71,6 @@ test('Valid CREATE transaction using sync', t => {
|
|||||||
.then(resTx => t.truthy(resTx))
|
.then(resTx => t.truthy(resTx))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Valid TRANSFER transaction with single Ed25519 input', t => {
|
test('Valid TRANSFER transaction with single Ed25519 input', t => {
|
||||||
const conn = new Connection(API_PATH)
|
const conn = new Connection(API_PATH)
|
||||||
const createTx = Transaction.makeCreateTransaction(
|
const createTx = Transaction.makeCreateTransaction(
|
||||||
@ -108,7 +100,6 @@ test('Valid TRANSFER transaction with single Ed25519 input', t => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Valid TRANSFER transaction with multiple Ed25519 inputs', t => {
|
test('Valid TRANSFER transaction with multiple Ed25519 inputs', t => {
|
||||||
const conn = new Connection(API_PATH)
|
const conn = new Connection(API_PATH)
|
||||||
const createTx = Transaction.makeCreateTransaction(
|
const createTx = Transaction.makeCreateTransaction(
|
||||||
@ -139,7 +130,6 @@ test('Valid TRANSFER transaction with multiple Ed25519 inputs', t => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Valid TRANSFER transaction with multiple Ed25519 inputs from different transactions', t => {
|
test('Valid TRANSFER transaction with multiple Ed25519 inputs from different transactions', t => {
|
||||||
const conn = new Connection(API_PATH)
|
const conn = new Connection(API_PATH)
|
||||||
const carol = new Ed25519Keypair()
|
const carol = new Ed25519Keypair()
|
||||||
@ -264,7 +254,6 @@ test('Search for spent and unspent outputs of a given public key', t => {
|
|||||||
const trentCondition = Transaction.makeEd25519Condition(trent.publicKey)
|
const trentCondition = Transaction.makeEd25519Condition(trent.publicKey)
|
||||||
const trentOutput = Transaction.makeOutput(trentCondition)
|
const trentOutput = Transaction.makeOutput(trentCondition)
|
||||||
|
|
||||||
|
|
||||||
const createTx = Transaction.makeCreateTransaction(
|
const createTx = Transaction.makeCreateTransaction(
|
||||||
asset(),
|
asset(),
|
||||||
metaData,
|
metaData,
|
||||||
@ -295,7 +284,6 @@ test('Search for spent and unspent outputs of a given public key', t => {
|
|||||||
.then(outputs => t.truthy(outputs.length === 2))
|
.then(outputs => t.truthy(outputs.length === 2))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Search for unspent outputs for a given public key', t => {
|
test('Search for unspent outputs for a given public key', t => {
|
||||||
const conn = new Connection(API_PATH)
|
const conn = new Connection(API_PATH)
|
||||||
const carol = new Ed25519Keypair()
|
const carol = new Ed25519Keypair()
|
||||||
@ -335,7 +323,6 @@ test('Search for unspent outputs for a given public key', t => {
|
|||||||
.then(outputs => t.truthy(outputs.length === 2))
|
.then(outputs => t.truthy(outputs.length === 2))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Search for spent outputs for a given public key', t => {
|
test('Search for spent outputs for a given public key', t => {
|
||||||
const conn = new Connection(API_PATH)
|
const conn = new Connection(API_PATH)
|
||||||
const carol = new Ed25519Keypair()
|
const carol = new Ed25519Keypair()
|
||||||
@ -375,7 +362,6 @@ test('Search for spent outputs for a given public key', t => {
|
|||||||
.then(outputs => t.truthy(outputs.length === 1))
|
.then(outputs => t.truthy(outputs.length === 1))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Search for an asset', t => {
|
test('Search for an asset', t => {
|
||||||
const conn = new Connection(API_PATH)
|
const conn = new Connection(API_PATH)
|
||||||
|
|
||||||
@ -398,7 +384,6 @@ test('Search for an asset', t => {
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Search for metadata', t => {
|
test('Search for metadata', t => {
|
||||||
const conn = new Connection(API_PATH)
|
const conn = new Connection(API_PATH)
|
||||||
|
|
||||||
@ -421,7 +406,6 @@ test('Search for metadata', t => {
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Search blocks containing a transaction', t => {
|
test('Search blocks containing a transaction', t => {
|
||||||
const conn = new Connection(API_PATH)
|
const conn = new Connection(API_PATH)
|
||||||
|
|
||||||
@ -443,7 +427,6 @@ test('Search blocks containing a transaction', t => {
|
|||||||
.then(transactions => t.truthy(transactions.length === 1))
|
.then(transactions => t.truthy(transactions.length === 1))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Search transaction containing an asset', t => {
|
test('Search transaction containing an asset', t => {
|
||||||
const conn = new Connection(API_PATH)
|
const conn = new Connection(API_PATH)
|
||||||
|
|
||||||
@ -465,7 +448,8 @@ test('Search transaction containing an asset', t => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Content-Type cannot be set', t => {
|
test('Content-Type cannot be set', t => {
|
||||||
t.throws(() => new Connection(API_PATH, { 'Content-Type': 'application/json' }), Error)
|
t.throws(() => new Connection(API_PATH, { 'Content-Type': 'application/json' }), {
|
||||||
|
instanceOf: Error
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
import test from 'ava'
|
import test from 'ava'
|
||||||
import Connection from '../../src/connection'
|
import Connection from '../../src/connection'
|
||||||
|
|
||||||
|
|
||||||
const conn = new Connection()
|
const conn = new Connection()
|
||||||
|
|
||||||
test('Ensure that BackoffTimedelta works properly', t => {
|
test('Ensure that BackoffTimedelta works properly', t => {
|
||||||
@ -18,14 +17,10 @@ test('Ensure that BackoffTimedelta works properly', t => {
|
|||||||
|
|
||||||
test('Ensure that updateBackoffTime throws and error on TimeoutError', async t => {
|
test('Ensure that updateBackoffTime throws and error on TimeoutError', async t => {
|
||||||
const req = conn.transport.pickConnection()
|
const req = conn.transport.pickConnection()
|
||||||
const target = {
|
const errorMessage = 'TimeoutError'
|
||||||
message: 'TimeoutError'
|
req.connectionError = new Error(errorMessage)
|
||||||
}
|
|
||||||
req.connectionError = target
|
|
||||||
|
|
||||||
const error = t.throws(() => {
|
t.throws(() => {
|
||||||
req.updateBackoffTime()
|
req.updateBackoffTime()
|
||||||
})
|
}, { instanceOf: Error, message: errorMessage })
|
||||||
|
|
||||||
t.deepEqual(target, error)
|
|
||||||
})
|
})
|
||||||
|
@ -9,7 +9,6 @@ const sanitize = rewire('../../src/sanitize.js')
|
|||||||
const applyFilterOnObject = sanitize.__get__('applyFilterOnObject')
|
const applyFilterOnObject = sanitize.__get__('applyFilterOnObject')
|
||||||
const filterFromObject = sanitize.__get__('filterFromObject')
|
const filterFromObject = sanitize.__get__('filterFromObject')
|
||||||
|
|
||||||
|
|
||||||
test('Ensure that null filter returns same object', t => {
|
test('Ensure that null filter returns same object', t => {
|
||||||
const expected = { 'testObj': 'test' }
|
const expected = { 'testObj': 'test' }
|
||||||
const actual = applyFilterOnObject({ 'testObj': 'test' }, null)
|
const actual = applyFilterOnObject({ 'testObj': 'test' }, null)
|
||||||
@ -17,7 +16,6 @@ test('Ensure that null filter returns same object', t => {
|
|||||||
t.deepEqual(actual, expected)
|
t.deepEqual(actual, expected)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Ensure function filter with isInclusion true works properly', t => {
|
test('Ensure function filter with isInclusion true works properly', t => {
|
||||||
const testObj = [true, false, undefined, '', 0, null]
|
const testObj = [true, false, undefined, '', 0, null]
|
||||||
const expected = { 0: true }
|
const expected = { 0: true }
|
||||||
@ -26,7 +24,6 @@ test('Ensure function filter with isInclusion true works properly', t => {
|
|||||||
t.deepEqual(actual, expected)
|
t.deepEqual(actual, expected)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Ensure function filter with isInclusion false works properly', t => {
|
test('Ensure function filter with isInclusion false works properly', t => {
|
||||||
const testObj = [false, true, 1, 10, 'this will be removed as it is truthy']
|
const testObj = [false, true, 1, 10, 'this will be removed as it is truthy']
|
||||||
const expected = { 0: false }
|
const expected = { 0: false }
|
||||||
@ -35,7 +32,6 @@ test('Ensure function filter with isInclusion false works properly', t => {
|
|||||||
t.deepEqual(actual, expected)
|
t.deepEqual(actual, expected)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Ensure array filter with isInclusion true works properly', t => {
|
test('Ensure array filter with isInclusion true works properly', t => {
|
||||||
const testObj = [true, false, undefined, '', 0, null]
|
const testObj = [true, false, undefined, '', 0, null]
|
||||||
const expected = { 0: true }
|
const expected = { 0: true }
|
||||||
@ -44,7 +40,6 @@ test('Ensure array filter with isInclusion true works properly', t => {
|
|||||||
t.deepEqual(actual, expected)
|
t.deepEqual(actual, expected)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Ensure array filter with isInclusion false works properly', t => {
|
test('Ensure array filter with isInclusion false works properly', t => {
|
||||||
const testObj = [false, true, 1, 10]
|
const testObj = [false, true, 1, 10]
|
||||||
const expected = { 0: false }
|
const expected = { 0: false }
|
||||||
@ -53,12 +48,8 @@ test('Ensure array filter with isInclusion false works properly', t => {
|
|||||||
t.deepEqual(actual, expected)
|
t.deepEqual(actual, expected)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Ensure throws error when given invalid filter', t => {
|
test('Ensure throws error when given invalid filter', t => {
|
||||||
const error = t.throws(() => {
|
t.throws(() => {
|
||||||
filterFromObject({}, 'lol')
|
filterFromObject({}, 'lol')
|
||||||
}, Error)
|
}, { instanceOf: Error, message: 'The given filter is not an array or function. Filter aborted' })
|
||||||
|
|
||||||
t.is(error.message, 'The given filter is not an array or function. Filter aborted')
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -41,12 +41,10 @@ test('formatText test type 3', t => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('formatText test throws', t => {
|
test('formatText test throws', t => {
|
||||||
const error = t.throws(() => {
|
t.throws(() => {
|
||||||
formatText(
|
formatText(
|
||||||
'This will give ${error.}', // eslint-disable-line no-template-curly-in-string
|
'This will give ${error.}', // eslint-disable-line no-template-curly-in-string
|
||||||
{ error: [{}] }
|
{ error: [{}] }
|
||||||
)
|
)
|
||||||
}, SyntaxError)
|
}, { instanceOf: SyntaxError, message: '[formatText] failed to parse named argument key: error.' })
|
||||||
|
|
||||||
t.is(error.message, '[formatText] failed to parse named argument key: error.')
|
|
||||||
})
|
})
|
||||||
|
@ -34,7 +34,6 @@ test('Sha256Condition fulfillment', t => {
|
|||||||
t.deepEqual(target, Transaction.makeSha256Condition(preimage))
|
t.deepEqual(target, Transaction.makeSha256Condition(preimage))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Threshold condition encoding', t => {
|
test('Threshold condition encoding', t => {
|
||||||
const publicKey = '4zvwRjXUKGfvwnParsHAS3HuSVzV5cA4McphgmoCtajS'
|
const publicKey = '4zvwRjXUKGfvwnParsHAS3HuSVzV5cA4McphgmoCtajS'
|
||||||
const ed25519 = Transaction.makeEd25519Condition(publicKey, false)
|
const ed25519 = Transaction.makeEd25519Condition(publicKey, false)
|
||||||
@ -64,7 +63,6 @@ test('Threshold condition encoding', t => {
|
|||||||
t.deepEqual(target, output)
|
t.deepEqual(target, output)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Fulfillment correctly formed', t => {
|
test('Fulfillment correctly formed', t => {
|
||||||
const alice = new Ed25519Keypair()
|
const alice = new Ed25519Keypair()
|
||||||
const txCreate = Transaction.makeCreateTransaction(
|
const txCreate = Transaction.makeCreateTransaction(
|
||||||
@ -115,23 +113,6 @@ test('Delegated signature is correct', t => {
|
|||||||
t.deepEqual(signCreateTransaction, delegatedSignCreateTransaction)
|
t.deepEqual(signCreateTransaction, delegatedSignCreateTransaction)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('CryptoConditions JSON load', t => {
|
|
||||||
const cond = ccJsonLoad({
|
|
||||||
type: 'threshold-sha-256',
|
|
||||||
threshold: 1,
|
|
||||||
subconditions: [{
|
|
||||||
type: 'ed25519-sha-256',
|
|
||||||
public_key: 'a'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
hash: 'a'
|
|
||||||
}],
|
|
||||||
})
|
|
||||||
t.truthy(cond.subconditions.length === 2)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
test('CryptoConditions JSON load', t => {
|
test('CryptoConditions JSON load', t => {
|
||||||
const cond = ccJsonLoad({
|
const cond = ccJsonLoad({
|
||||||
type: 'threshold-sha-256',
|
type: 'threshold-sha-256',
|
||||||
|
@ -15,7 +15,6 @@ import {
|
|||||||
transferTx
|
transferTx
|
||||||
} from '../constants'
|
} from '../constants'
|
||||||
|
|
||||||
|
|
||||||
test('Create valid output with default amount', t => {
|
test('Create valid output with default amount', t => {
|
||||||
const condition = {
|
const condition = {
|
||||||
details: {
|
details: {
|
||||||
@ -32,7 +31,6 @@ test('Create valid output with default amount', t => {
|
|||||||
t.deepEqual(res, expected)
|
t.deepEqual(res, expected)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Create valid output with custom amount', t => {
|
test('Create valid output with custom amount', t => {
|
||||||
const condition = {
|
const condition = {
|
||||||
details: {
|
details: {
|
||||||
@ -65,12 +63,10 @@ test('Pass condition not based on public_keys to makeOutput', t => {
|
|||||||
t.deepEqual(res, expected)
|
t.deepEqual(res, expected)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('makeOutput throws TypeError with incorrect amount type', t => {
|
test('makeOutput throws TypeError with incorrect amount type', t => {
|
||||||
t.throws(() => Transaction.makeOutput({}, 1337), TypeError)
|
t.throws(() => Transaction.makeOutput({}, 1337), { instanceOf: TypeError })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Create TRANSFER transaction based on CREATE transaction', t => {
|
test('Create TRANSFER transaction based on CREATE transaction', t => {
|
||||||
sinon.spy(Transaction, 'makeTransaction')
|
sinon.spy(Transaction, 'makeTransaction')
|
||||||
Transaction.makeTransferTransaction(
|
Transaction.makeTransferTransaction(
|
||||||
@ -95,7 +91,6 @@ test('Create TRANSFER transaction based on CREATE transaction', t => {
|
|||||||
Transaction.makeTransaction.restore()
|
Transaction.makeTransaction.restore()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('Create TRANSFER transaction based on TRANSFER transaction', t => {
|
test('Create TRANSFER transaction based on TRANSFER transaction', t => {
|
||||||
sinon.spy(Transaction, 'makeTransaction')
|
sinon.spy(Transaction, 'makeTransaction')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user