diff --git a/packages/utxo-lib/tests/__fixtures__/coinselect/coinselect-errors.ts b/packages/utxo-lib/tests/__fixtures__/coinselect/coinselect-errors.ts index cd601908175..62dba86e692 100644 --- a/packages/utxo-lib/tests/__fixtures__/coinselect/coinselect-errors.ts +++ b/packages/utxo-lib/tests/__fixtures__/coinselect/coinselect-errors.ts @@ -1,4 +1,4 @@ -export default [ +export const coinselectFixturesErrors = [ { description: 'missing input info', feeRate: 10, diff --git a/packages/utxo-lib/tests/__fixtures__/coinselect/coinselect-index.ts b/packages/utxo-lib/tests/__fixtures__/coinselect/coinselect-index.ts index 5055b2df871..a73a0c63904 100644 --- a/packages/utxo-lib/tests/__fixtures__/coinselect/coinselect-index.ts +++ b/packages/utxo-lib/tests/__fixtures__/coinselect/coinselect-index.ts @@ -1,4 +1,4 @@ -export default [ +export const coinselectIndexFixture = [ { description: '1 output, no change, 1 input is unspendable coinbase', feeRate: 10, diff --git a/packages/utxo-lib/tests/__fixtures__/compose.crosscheck.ts b/packages/utxo-lib/tests/__fixtures__/compose.crosscheck.ts index b67a96ac20a..87ad64e42d3 100644 --- a/packages/utxo-lib/tests/__fixtures__/compose.crosscheck.ts +++ b/packages/utxo-lib/tests/__fixtures__/compose.crosscheck.ts @@ -1,6 +1,6 @@ import { UTXO } from './compose'; -export default [ +export const fixturesCrossCheck = [ { description: '1 input, 1 output, no change', request: { diff --git a/packages/utxo-lib/tests/__fixtures__/compose.ts b/packages/utxo-lib/tests/__fixtures__/compose.ts index 149c55fd1bc..d14de7f6578 100644 --- a/packages/utxo-lib/tests/__fixtures__/compose.ts +++ b/packages/utxo-lib/tests/__fixtures__/compose.ts @@ -8,7 +8,7 @@ export const UTXO = { amount: '102001', }; -export default [ +export const composeTxFixture = [ { description: 'builds a simple tx without change', request: { diff --git a/packages/utxo-lib/tests/coinselect/coinselect.test.ts b/packages/utxo-lib/tests/coinselect/coinselect.test.ts index 811d1dd0600..4e70d1f2ca6 100644 --- a/packages/utxo-lib/tests/coinselect/coinselect.test.ts +++ b/packages/utxo-lib/tests/coinselect/coinselect.test.ts @@ -1,10 +1,10 @@ import { coinselect } from '../../src/coinselect'; -import fixtures from '../__fixtures__/coinselect/coinselect-index'; -import fixturesErrors from '../__fixtures__/coinselect/coinselect-errors'; +import { coinselectIndexFixture } from '../__fixtures__/coinselect/coinselect-index'; +import { coinselectFixturesErrors } from '../__fixtures__/coinselect/coinselect-errors'; import * as utils from './test.utils'; describe('coinselect errors', () => { - fixturesErrors.forEach(f => { + coinselectFixturesErrors.forEach(f => { it(f.description, () => { const inputs = utils.expand(f.inputs, true); const outputs = utils.expand(f.outputs, false); @@ -24,7 +24,7 @@ describe('coinselect errors', () => { }); describe('coinselect index', () => { - fixtures.forEach(f => { + coinselectIndexFixture.forEach(f => { it(f.description, () => { const inputs = utils.expand(f.inputs as any, true); const outputs = utils.expand(f.outputs as any, false); diff --git a/packages/utxo-lib/tests/compose.test.ts b/packages/utxo-lib/tests/compose.test.ts index e6682ac2b41..c216171d4df 100644 --- a/packages/utxo-lib/tests/compose.test.ts +++ b/packages/utxo-lib/tests/compose.test.ts @@ -2,19 +2,20 @@ import { composeTx } from '../src'; import * as NETWORKS from '../src/networks'; import { verifyTxBytes } from './compose.utils'; -import fixtures from './__fixtures__/compose'; -import fixturesCrossCheck from './__fixtures__/compose.crosscheck'; +import { composeTxFixture } from './__fixtures__/compose'; +import { fixturesCrossCheck } from './__fixtures__/compose.crosscheck'; // keyof typeof NETWORKS; const getNetwork = (name?: string) => // @ts-expect-error expression of type string can't be used to index type typeof name === 'string' && NETWORKS[name] ? NETWORKS[name] : NETWORKS.bitcoin; -describe('composeTx', () => { - fixtures.forEach(f => { +describe(composeTx.name, () => { + composeTxFixture.forEach(f => { const network = getNetwork(f.request.network); const request = { ...f.request, network }; const result: any = { ...f.result }; + it(f.description, () => { const tx = composeTx(request as any); expect(tx).toEqual(result);