mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
add unit test for compute.checkOutput()
This commit is contained in:
parent
fd8ad9d96b
commit
2096329341
@ -93,7 +93,7 @@ export class OceanCompute extends Instantiable {
|
||||
* @param {Output} output Output section used for publishing the result.
|
||||
* @return {Promise<Output>} Returns output object
|
||||
*/
|
||||
private checkOutput(consumerAccount: Account, output?: Output): Output {
|
||||
public checkOutput(consumerAccount: Account, output?: Output): Output {
|
||||
const isDefault =
|
||||
!output || (!output.publishAlgorithmLog && !output.publishOutput)
|
||||
|
||||
|
@ -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)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user