-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): add comparison test skeleton for blockfrost network info p…
…rovider
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/e2e/test/blockfrost-providers/networkInfo.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
}); | ||
}); |