Skip to content

Commit

Permalink
test(a3p): add new test case for vStorage readFully method
Browse files Browse the repository at this point in the history
rel: #10574
  • Loading branch information
Jorge-Lopes committed Nov 26, 2024
1 parent 1dd4589 commit 063d01e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions a3p-integration/proposals/z:acceptance/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -ueo pipefail
# Place here any test that should be executed using the executed proposal.
# The effects of this step are not persisted in further proposal layers.

# test readFully method
# XXX to be removed
echo ACCEPTANCE TESTING vstorage
yarn ava vstorage.test.js

# test the state right after the previous proposals
yarn ava initial.test.js

Expand Down
21 changes: 21 additions & 0 deletions a3p-integration/proposals/z:acceptance/vstorage.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* global fetch */

import test from 'ava';
import { makeVStorage } from '@agoric/client-utils';
import { networkConfig } from './test-lib/index.js';

test('readFully should vstorage node history', async t => {
const vstorage = makeVStorage({ fetch }, networkConfig);
const { readLatest, readAt, readFully } = vstorage;

// this test was executed with different nodes and the same behavior was observed
const nodePath = 'published.committees.Economic_Committee.latestQuestion';

console.log('readLatest: ', await readLatest(nodePath));
console.log('readLatest: ', await readAt(nodePath));

// Return a rejected promise
console.log('readLatest: ', await readFully(nodePath));

t.pass();
});

0 comments on commit 063d01e

Please sign in to comment.