Skip to content

Commit

Permalink
pass sample test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasir Shariff committed Jan 9, 2024
1 parent d09ec2f commit 3308040
Show file tree
Hide file tree
Showing 18 changed files with 169 additions and 40 deletions.
12 changes: 10 additions & 2 deletions __tests__/08.custom-network.ava.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import anyTest, {TestFn} from 'ava';

// To run this test, you need to set the NEAR_RPC_API_KEY environment variable tied the Pagoda testnet network.
// And the NEAR_WORKSPACES_NETWORK environment variable to 'custom'.
//
// Sample: NEAR_WORKSPACES_NETWORK=custom NEAR_RPC_API_KEY="xxx" yarn test...
if (getNetworkFromEnv() === 'custom' && process.env.NEAR_RPC_API_KEY !== '') {
const test = anyTest as TestFn<{
worker: Worker;
Expand All @@ -25,8 +27,14 @@ if (getNetworkFromEnv() === 'custom' && process.env.NEAR_RPC_API_KEY !== '') {
});

test('Ping network', async t => {
await t.context.worker.provider.block({finality: 'final'});
console.log('Network is alive!');
try {
await t.context.worker.provider.block({finality: 'final'});
} catch (error: unknown) {
t.fail(`Failed to ping the network: ${error as string}`);
return;
}

t.pass('Network pinged successfully!');
});
}

8 changes: 8 additions & 0 deletions packages/js/dist/account/account-manager.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/js/dist/account/account-manager.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 25 additions & 2 deletions packages/js/dist/account/account-manager.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3308040

Please sign in to comment.