diff --git a/src/ocean/OceanCompute.ts b/src/ocean/OceanCompute.ts index ea8fc33..1c0c653 100644 --- a/src/ocean/OceanCompute.ts +++ b/src/ocean/OceanCompute.ts @@ -93,7 +93,7 @@ export class OceanCompute extends Instantiable { * @param {Output} output Output section used for publishing the result. * @return {Promise} Returns output object */ - private checkOutput(consumerAccount: Account, output?: Output): Output { + public checkOutput(consumerAccount: Account, output?: Output): Output { const isDefault = !output || (!output.publishAlgorithmLog && !output.publishOutput) diff --git a/test/unit/ocean/OceanCompute.test.ts b/test/unit/ocean/OceanCompute.test.ts index 74901bb..9026c22 100644 --- a/test/unit/ocean/OceanCompute.test.ts +++ b/test/unit/ocean/OceanCompute.test.ts @@ -103,4 +103,27 @@ describe('OceanCompute', () => { assert(response[0].status === ComputeJobStatus.Started) }) }) + + describe('#checkOutput()', () => { + it('should return default values', async () => { + const defaultOutput = { publishAlgorithmLog: false, publishOutput: false } + const output = compute.checkOutput(account, undefined) + assert.deepEqual(output, defaultOutput) + }) + + it('should return output values', async () => { + const newOutput = { + publishAlgorithmLog: true, + publishOutput: true, + brizoAddress: 'hello', + brizoUri: 'hello', + metadataUri: 'hello', + nodeUri: 'hello', + owner: '0xhello', + secretStoreUri: 'hello' + } + const output = compute.checkOutput(account, newOutput) + assert.deepEqual(output, newOutput) + }) + }) })