Skip to content

Commit

Permalink
test(e2e): add comparison test skeleton for blockfrost network info p…
Browse files Browse the repository at this point in the history
…rovider
  • Loading branch information
iccicci committed Oct 22, 2024
1 parent eb73102 commit 33de31b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/e2e/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const realAdaTestFileNames = [
module.exports = {
projects: [
{ ...project('blockfrost'), globalSetup: './test/blockfrost/setup.ts' },
project('blockfrost-providers'),
project('local-network'),
project('long-running'),
project('ogmios'),
Expand Down
1 change: 1 addition & 0 deletions packages/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"load-test-custom:wallet-restoration": "ts-node test/load-test-custom/wallet-restoration/wallet-restoration.test.ts",
"test": "echo 'test' command not implemented yet",
"test:blockfrost": "jest -c jest.config.js --forceExit --selectProjects blockfrost --runInBand --verbose",
"test:blockfrost:providers": "jest -c jest.config.js --forceExit --selectProjects blockfrost-providers --runInBand --verbose",
"test:utils": "jest -c jest.config.js --forceExit --selectProjects utils --verbose",
"test:long-running": "jest -c jest.config.js --forceExit --selectProjects long-running --runInBand --verbose",
"test:local-network": "jest -c jest.config.js --forceExit --selectProjects local-network --runInBand --verbose",
Expand Down
26 changes: 26 additions & 0 deletions packages/e2e/test/blockfrost-providers/networkInfo.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// cSpell:ignore cardano utxos

import { NetworkInfoProvider } from '@cardano-sdk/core';
import { logger } from '@cardano-sdk/util-dev';
import { networkInfoHttpProvider } from '@cardano-sdk/cardano-services-client';
import { toSerializableObject } from '@cardano-sdk/util';

// LW-11697 to enable this
describe.skip('Web Socket', () => {
const legacyProvider = networkInfoHttpProvider({ baseUrl: 'http://localhost:4000/', logger });
const provider = networkInfoHttpProvider({ baseUrl: 'http://localhost:4001/', logger });

const methods: (keyof NetworkInfoProvider)[] = [
'eraSummaries',
'genesisParameters',
'lovelaceSupply',
'protocolParameters',
'stake'
];

test.each(methods)('compare %s', async (method) => {
const [legacyResponse, response] = await Promise.all([legacyProvider[method](), provider[method]()]);

expect(toSerializableObject(response)).toEqual(toSerializableObject(legacyResponse));
});
});

0 comments on commit 33de31b

Please sign in to comment.