Skip to content

Commit

Permalink
chore: update jest version
Browse files Browse the repository at this point in the history
  • Loading branch information
asiaziola committed May 21, 2024
1 parent 0a11979 commit 55945e6
Show file tree
Hide file tree
Showing 3 changed files with 744 additions and 364 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.1",
"gen-esm-wrapper": "^1.1.3",
"jest": "^28.1.3",
"jest": "^29.7.0",
"json-schema-to-typescript": "^11.0.1",
"node-stdlib-browser": "^1.2.0",
"prettier": "^2.3.2",
Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/unit/gateway-interactions.loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('WarpGatewayInteractionsLoader -> load', () => {
it('should be called with correct params', async () => {
const loader = getLoader();
await loader.load(contractId, fromBlockHeight, toBlockHeight);
expect(fetchMock).toBeCalledWith(`${baseUrl}&fromSdk=true`);
expect(fetchMock).toBeCalledWith(`${baseUrl}&fromSdk=true`, undefined);
});
it('should be called accordingly to the amount of pages', async () => {
const fetchMock = jest.spyOn(global, 'fetch').mockImplementation(
Expand All @@ -110,7 +110,7 @@ describe('WarpGatewayInteractionsLoader -> load', () => {
);
const loader = getLoader();
await loader.load(contractId, fromBlockHeight, toBlockHeight);
expect(fetchMock).toBeCalledWith(`${baseUrl}&fromSdk=true`);
expect(fetchMock).toBeCalledWith(`${baseUrl}&fromSdk=true`, undefined);
/*expect(fetchMock).toBeCalledWith(`${baseUrl}&page=2&fromSdk=true`);
expect(fetchMock).toBeCalledWith(`${baseUrl}&page=3&fromSdk=true`);
expect(fetchMock).toBeCalledWith(`${baseUrl}&page=4&fromSdk=true`);
Expand All @@ -120,12 +120,12 @@ describe('WarpGatewayInteractionsLoader -> load', () => {
it('should be called with confirmationStatus set to "confirmed"', async () => {
const loader = getLoader({ confirmed: true });
await loader.load(contractId, fromBlockHeight, toBlockHeight);
expect(fetchMock).toBeCalledWith(`${baseUrl}&fromSdk=true&confirmationStatus=confirmed`);
expect(fetchMock).toBeCalledWith(`${baseUrl}&fromSdk=true&confirmationStatus=confirmed`, undefined);
});
it('should be called with confirmationStatus set to "not_corrupted"', async () => {
const loader = getLoader({ notCorrupted: true });
await loader.load(contractId, fromBlockHeight, toBlockHeight);
expect(fetchMock).toBeCalledWith(`${baseUrl}&fromSdk=true&confirmationStatus=not_corrupted`);
expect(fetchMock).toBeCalledWith(`${baseUrl}&fromSdk=true&confirmationStatus=not_corrupted`, undefined);
});
it('should throw an error in case of timeout', async () => {
jest.spyOn(global, 'fetch').mockImplementation(() => Promise.reject({ status: 504, ok: false }));
Expand Down
Loading

0 comments on commit 55945e6

Please sign in to comment.