Skip to content

Commit b4ce30b

Browse files
iccicciginnun
authored andcommitted
test(e2e): add comparison test skeleton for blockfrost network info provider
1 parent 8d9f847 commit b4ce30b

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

packages/e2e/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const realAdaTestFileNames = [
2626
module.exports = {
2727
projects: [
2828
{ ...project('blockfrost'), globalSetup: './test/blockfrost/setup.ts' },
29+
project('blockfrost-providers'),
2930
project('local-network'),
3031
project('long-running'),
3132
project('ogmios'),

packages/e2e/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"load-test-custom:wallet-restoration": "ts-node test/load-test-custom/wallet-restoration/wallet-restoration.test.ts",
2424
"test": "echo 'test' command not implemented yet",
2525
"test:blockfrost": "jest -c jest.config.js --forceExit --selectProjects blockfrost --runInBand --verbose",
26+
"test:blockfrost:providers": "jest -c jest.config.js --forceExit --selectProjects blockfrost-providers --runInBand --verbose",
2627
"test:utils": "jest -c jest.config.js --forceExit --selectProjects utils --verbose",
2728
"test:long-running": "jest -c jest.config.js --forceExit --selectProjects long-running --runInBand --verbose",
2829
"test:local-network": "jest -c jest.config.js --forceExit --selectProjects local-network --runInBand --verbose",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// cSpell:ignore cardano utxos
2+
3+
import { NetworkInfoProvider } from '@cardano-sdk/core';
4+
import { logger } from '@cardano-sdk/util-dev';
5+
import { networkInfoHttpProvider } from '@cardano-sdk/cardano-services-client';
6+
import { toSerializableObject } from '@cardano-sdk/util';
7+
8+
// LW-11697 to enable this
9+
describe.skip('Web Socket', () => {
10+
const legacyProvider = networkInfoHttpProvider({ baseUrl: 'http://localhost:4000/', logger });
11+
const provider = networkInfoHttpProvider({ baseUrl: 'http://localhost:4001/', logger });
12+
13+
const methods: (keyof NetworkInfoProvider)[] = [
14+
'eraSummaries',
15+
'genesisParameters',
16+
'lovelaceSupply',
17+
'protocolParameters',
18+
'stake'
19+
];
20+
21+
test.each(methods)('compare %s', async (method) => {
22+
const [legacyResponse, response] = await Promise.all([legacyProvider[method](), provider[method]()]);
23+
24+
expect(toSerializableObject(response)).toEqual(toSerializableObject(legacyResponse));
25+
});
26+
});

0 commit comments

Comments
 (0)