diff --git a/__tests__/__snapshots__/ain.test.ts.snap b/__tests__/__snapshots__/ain.test.ts.snap index 1264fcb..9ce3296 100644 --- a/__tests__/__snapshots__/ain.test.ts.snap +++ b/__tests__/__snapshots__/ain.test.ts.snap @@ -1,27 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ain-js Core getStateUsage 1`] = ` -Object { - "available": Object { - "tree_bytes": 25000000, - "tree_height": 30, - "tree_size": 156250, - }, - "protoVer": "erased", - "staking": Object { - "app": 0, - "total": 2, - "unstakeable": 0, - }, - "usage": Object { - "tree_bytes": 0, - "tree_height": 0, - "tree_max_siblings": 0, - "tree_size": 0, - }, -} -`; - exports[`ain-js Database evalOwner 1`] = ` Object { "code": 0, @@ -205,6 +183,28 @@ Object { } `; +exports[`ain-js Database getStateUsage 1`] = ` +Object { + "available": Object { + "tree_bytes": 25000000, + "tree_height": 30, + "tree_size": 156250, + }, + "protoVer": "erased", + "staking": Object { + "app": 0, + "total": 2, + "unstakeable": 0, + }, + "usage": Object { + "tree_bytes": 0, + "tree_height": 0, + "tree_max_siblings": 0, + "tree_size": 0, + }, +} +`; + exports[`ain-js Database matchFunction 1`] = ` Object { "matched_config": Object { diff --git a/__tests__/ain.test.ts b/__tests__/ain.test.ts index 5db63ce..4095448 100644 --- a/__tests__/ain.test.ts +++ b/__tests__/ain.test.ts @@ -632,11 +632,6 @@ describe('ain-js', function() { // expect(await ain.getTransactionResult('0xabcdefghijklmnop')).toMatchSnapshot(); // }); - it('getStateUsage', async function() { - // with an app that does not exist yet - expect(eraseProtoVer(await ain.getStateUsage('test_new'))).toMatchSnapshot(); - }); - it('validateAppName returns true', async function () { expect(eraseProtoVer(await ain.validateAppName('test_new'))).toStrictEqual({ "is_valid": true, @@ -1449,6 +1444,18 @@ describe('ain-js', function() { }) }); + it('getStateUsage', async function() { + // with an app that does not exist yet + await ain.getStateUsage('test_new') + .then(res => { + expect(eraseProtoVer(res)).toMatchSnapshot(); + }) + .catch(error => { + console.log("error:", error); + fail('should not happen'); + }) + }); + /*it('on and off', function(done) { try { ain.db.ref().on('value', (snap:any) => console.log)